diff --git a/.gitignore b/.gitignore index 8e37be718b..792c0c8ccb 100644 --- a/.gitignore +++ b/.gitignore @@ -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 diff --git a/composer.json b/composer.json index 804dfb090c..9da1af9769 100644 --- a/composer.json +++ b/composer.json @@ -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": { diff --git a/tests/phpunit/includes/bootstrap.php b/tests/phpunit/includes/bootstrap.php index b557efd3d9..fed800ef3c 100644 --- a/tests/phpunit/includes/bootstrap.php +++ b/tests/phpunit/includes/bootstrap.php @@ -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 ); }