Changeset 51560 for trunk/tests/phpunit/includes/bootstrap.php
- Timestamp:
- 08/06/2021 12:35:01 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/includes/bootstrap.php
r51544 r51560 50 50 require_once __DIR__ . '/class-mockobject-autoload.php'; 51 51 spl_autoload_register( 'MockObject_Autoload::load', true, true ); 52 53 // Check that the PHPUnit Polyfills autoloader exists. 54 $phpunit_polyfills_autoloader = __DIR__ . '/../../../vendor/yoast/phpunit-polyfills/phpunitpolyfills-autoload.php'; 55 if ( ! file_exists( $phpunit_polyfills_autoloader ) ) { 56 echo "Error: You need to run `composer update` before running the tests.\n"; 57 echo "You can still use a PHPUnit phar to run them, but the dependencies do need to be installed.\n"; 58 exit( 1 ); 59 } 52 60 53 61 // If running core tests, check if all the required PHP extensions are loaded before running the test suite. … … 196 204 } 197 205 198 // Load separate WP_UnitTestCase classes for PHPUnit 7.5+ and older versions. 199 if ( version_compare( tests_get_phpunit_version(), '7.5', '>=' ) ) { 200 require __DIR__ . '/phpunit7/testcase.php'; 201 } else { 202 require __DIR__ . '/testcase.php'; 203 } 204 206 // Load the PHPUnit Polyfills autoloader (check for existence of the file is done earlier in the script). 207 require_once $phpunit_polyfills_autoloader; 208 unset( $phpunit_polyfills_autoloader ); 209 210 require __DIR__ . '/abstract-testcase.php'; 211 require __DIR__ . '/testcase.php'; 205 212 require __DIR__ . '/testcase-rest-api.php'; 206 213 require __DIR__ . '/testcase-rest-controller.php';
Note: See TracChangeset
for help on using the changeset viewer.