Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests: only use our own autoloader when testing via a PHAR #508

Merged
merged 1 commit into from
Aug 20, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions tests/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ function define_from_env($name, $default = false) {
define_from_env('REQUESTS_HTTP_PROXY_AUTH_USER');
define_from_env('REQUESTS_HTTP_PROXY_AUTH_PASS');

require_once dirname(__DIR__) . '/library/Requests.php';
Requests::register_autoloader();

if (is_dir(dirname(__DIR__) . '/vendor')
&& file_exists(dirname(__DIR__) . '/vendor/autoload.php')
Expand All @@ -42,6 +40,10 @@ function define_from_env($name, $default = false) {
// Load the PHPUnit Polyfills autoloader.
require_once $vendor_dir . '/yoast/phpunit-polyfills/phpunitpolyfills-autoload.php';

// Load the library autoloader.
require_once dirname(__DIR__) . '/library/Requests.php';
Requests::register_autoloader();

/*
* Autoloader specifically for the test files.
* Fixes issues with PHPUnit not being able to find test classes being extended when running
Expand Down