mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2025-10-16 12:05:38 +00:00
Build/Test Tools: Loosen the PHPUnit restriction.
**composer.json**: Remove the PHPUnit dependency in favor of allowing the PHPUnit Polyfills library to manage the supported PHPUnit version. This automatically now widens the supported PHPUnit versions to 5.7.21 to 9.5.8 (current). Letting the PHPUnit Polyfills handle the version constraints for PHPUnit prevents potential version conflicts in the future, as well as allows WordPress to benefit straight away when a new PHPUnit version would be released and the PHPUnit Polyfills package adds support for that PHPUnit version. **Test Bootstrap** Update the supported version number for PHPUnit 5.x, as the minimum PHPUnit 5.x version supported by the PHPUnit Polyfills is PHPUnit 5.7.21, and remove the PHPUnit maximum. **.gitignore and svn:ignore:** Add the PHPUnit cache file to the list of files to be ignored. Since PHPUnit 8, PHPUnit has a built-in caching feature which creates a `.phpunit.result.cache` file. This file should not be committed. Follow-up to [40536], [40853], [44701], [51559-51573]. Props jrf. See #46149. git-svn-id: https://develop.svn.wordpress.org/trunk@51574 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
aae784273f
commit
8def694fe4
1
.gitignore
vendored
1
.gitignore
vendored
@ -6,6 +6,7 @@ wp-tests-config.php
|
||||
.htaccess
|
||||
|
||||
# Files and folders related to build/test tools
|
||||
.phpunit.result.cache
|
||||
/phpunit.xml
|
||||
/.phpcs.xml
|
||||
/phpcs.xml
|
||||
|
||||
@ -17,7 +17,6 @@
|
||||
"squizlabs/php_codesniffer": "3.6.0",
|
||||
"wp-coding-standards/wpcs": "~2.3.0",
|
||||
"phpcompatibility/phpcompatibility-wp": "~2.1.2",
|
||||
"phpunit/phpunit": "^5.7 || ^6.5 || ^7.5",
|
||||
"yoast/phpunit-polyfills": "^1.0"
|
||||
},
|
||||
"scripts": {
|
||||
|
||||
@ -37,12 +37,12 @@ if ( defined( 'WP_RUN_CORE_TESTS' ) && WP_RUN_CORE_TESTS && ! is_dir( ABSPATH )
|
||||
|
||||
$phpunit_version = tests_get_phpunit_version();
|
||||
|
||||
if ( version_compare( $phpunit_version, '5.7', '<' ) || version_compare( $phpunit_version, '8.0', '>=' ) ) {
|
||||
if ( version_compare( $phpunit_version, '5.7.21', '<' ) ) {
|
||||
printf(
|
||||
"Error: Looks like you're using PHPUnit %s. WordPress requires at least PHPUnit 5.7 and is currently only compatible with PHPUnit up to 7.x.\n",
|
||||
"Error: Looks like you're using PHPUnit %s. WordPress requires at least PHPUnit 5.7.21.\n",
|
||||
$phpunit_version
|
||||
);
|
||||
echo "Please use the latest PHPUnit version from the 7.x branch.\n";
|
||||
echo "Please use the latest PHPUnit version supported for the PHP version you are running the tests on.\n";
|
||||
exit( 1 );
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user