mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2025-10-16 12:05:38 +00:00
The PHPUnit Polyfills are, since [51559], a required dependency for the WP test suite and, by extension, for plugin/theme integration test suites which are based on and use (parts of) the WP core test suite.
However, plugin/theme integration test suites may not use a full WordPress installation.
This commit:
* Removes the presumption that a full WP install, including `vendor` directory, will be available when the test `bootstrap.php` file is run.
* Makes the loading of the PHPUnit Polyfills autoload file more flexible by:
* Checking if the autoload class contained within the autoload file is already available before attempting to load the file.[[BR]]
This allows for plugin/theme integration test suites to load the `phpunitpolyfills-autoload.php` file from any location, as long as it is loaded before the WP core test `bootstrap.php` file is run.
* Allowing for the path to an arbitrary installation location for the PHPUnit Polyfills to be passed as a constant.[[BR]]
As long as the provided location is a valid file path and the `phpunitpolyfills-autoload.php` file exists in the provided location, that file will be loaded.[[BR]]
The constant can be declared in a plugin/theme integration test suite native test bootstrap file, or in the `wp-tests-config.php` file, or even in a `phpunit.xml[.dist]` file via `<php><const name="WP_TESTS_PHPUNIT_POLYFILLS_PATH" value="path/to/yoast/phpunit-polyfills"/></php>`.
* Adds a version check for the PHPUnit Polyfills to prevent a mismatch between the version of the package expected by WordPress and the version used by plugins/themes.[[BR]]
The version this checks for should be in line with the minimum version requirement for the PHPUnit Polyfills as declared in the `composer.json` file.[[BR]]
This version number should only be updated when new features added in later PHPUnit Polyfills releases are actually used in the WP core test suite.
* Adds appropriate error messages for every possible error condition.
* Upgrades the PHPUnit Polyfills to version 1.0.1, which now includes a version constant.
Follow-up to [51559-51577].
Props jrf, hellofromTonya, swissspidy, jeherve, thomasplevy, SergeyBiryukov.
See #46149.
git-svn-id: https://develop.svn.wordpress.org/trunk@51598 602fd350-edb4-49c9-b593-d223f7449a82
|
||
|---|---|---|
| .. | ||
| factory | ||
| phpunit6 | ||
| abstract-testcase.php | ||
| bootstrap.php | ||
| class-basic-object.php | ||
| class-basic-subclass.php | ||
| class-jsonserializable-object.php | ||
| class-wp-fake-block-type.php | ||
| class-wp-rest-test-configurable-controller.php | ||
| class-wp-rest-test-search-handler.php | ||
| class-wp-sitemaps-empty-test-provider.php | ||
| class-wp-sitemaps-large-test-provider.php | ||
| class-wp-sitemaps-test-provider.php | ||
| class-wp-test-stream.php | ||
| exceptions.php | ||
| factory.php | ||
| functions.php | ||
| install.php | ||
| mock-fs.php | ||
| mock-image-editor.php | ||
| mock-mailer.php | ||
| normalize-xml.xsl | ||
| object-cache.php | ||
| phpunit-adapter-testcase.php | ||
| plural-form-function.php | ||
| spy-rest-server.php | ||
| testcase-ajax.php | ||
| testcase-canonical.php | ||
| testcase-rest-api.php | ||
| testcase-rest-controller.php | ||
| testcase-rest-post-type-controller.php | ||
| testcase-xml.php | ||
| testcase-xmlrpc.php | ||
| testcase.php | ||
| trac.php | ||
| utils.php | ||
| wp-profiler.php | ||