Build/Test Tools: Use a custom autoloader for the PHPUnit 9.x mock object classes.

This prevents the classes from being loaded automatically via the `autoload-dev` directives when a Composer-installed PHPUnit 5.x or 6.x version is used, as that would break the test run.

It is expected that this autoloader will be removed soon, as it should no longer be needed when the PHPUnit version constraints are widened.

Notes:
* The autoloader file will be loaded from the Test bootstrap.
* The autoloader will always be registered and directed to queue itself _before_ the Composer autoload file (which will already have been registered).
* The autoloader will only actually load the WP copies of the files/classes when PHP 8.0 in combination with PHPUnit 7.x is detected. In all other cases, the autoloader will bow out, which effectively then defers to the Composer autoload file to load the files as shipped with the installed PHPUnit version.

Follow-up to [48957], [49037], [51543].

Props jrf.
See #47381.
Built from https://develop.svn.wordpress.org/trunk@51544


git-svn-id: http://core.svn.wordpress.org/trunk@51155 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2021-08-04 19:26:00 +00:00
parent 6e4d0d8f48
commit 3db37d3459

View File

@ -13,7 +13,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.9-alpha-51543';
$wp_version = '5.9-alpha-51544';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.