From 065807745f4d98a5130a615dce546875531cd547 Mon Sep 17 00:00:00 2001 From: Nathaniel Catchpole Date: Tue, 3 Apr 2018 12:41:33 +0100 Subject: [PATCH] Issue #2932606 by jibran, mpdonadio, alexpott, catch: Use PHPUnit 6 for PHP 7.0 / 7.1 testing --- core/lib/Drupal/Core/Composer/Composer.php | 4 ++-- core/scripts/run-tests.sh | 2 +- core/tests/bootstrap.php | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/core/lib/Drupal/Core/Composer/Composer.php b/core/lib/Drupal/Core/Composer/Composer.php index 04f9564c7f0..c84797fde7b 100644 --- a/core/lib/Drupal/Core/Composer/Composer.php +++ b/core/lib/Drupal/Core/Composer/Composer.php @@ -160,7 +160,7 @@ EOT; return; } - // If the PHP version is 7.2 or above and PHPUnit is less than version 6 + // If the PHP version is 7.0 or above and PHPUnit is less than version 6 // call the drupal-phpunit-upgrade script to upgrade PHPUnit. if (!static::upgradePHPUnitCheck($phpunit_package->getVersion())) { $event->getComposer() @@ -182,7 +182,7 @@ EOT; * TRUE if the PHPUnit needs to be upgraded, FALSE if not. */ public static function upgradePHPUnitCheck($phpunit_version) { - return !(version_compare(PHP_MAJOR_VERSION . '.' . PHP_MINOR_VERSION, '7.2') >= 0 && version_compare($phpunit_version, '6.1') < 0); + return !(version_compare(PHP_MAJOR_VERSION . '.' . PHP_MINOR_VERSION, '7.0') >= 0 && version_compare($phpunit_version, '6.1') < 0); } /** diff --git a/core/scripts/run-tests.sh b/core/scripts/run-tests.sh index 4916f8c4b72..6a8eaca8240 100644 --- a/core/scripts/run-tests.sh +++ b/core/scripts/run-tests.sh @@ -140,7 +140,7 @@ else { $phpunit_version = Version::id(); } if (!Composer::upgradePHPUnitCheck($phpunit_version)) { - simpletest_script_print_error("PHPUnit testing framework version 6 or greater is required when running on PHP 7.2 or greater. Run the command 'composer run-script drupal-phpunit-upgrade' in order to fix this."); + simpletest_script_print_error("PHPUnit testing framework version 6 or greater is required when running on PHP 7.0 or greater. Run the command 'composer run-script drupal-phpunit-upgrade' in order to fix this."); exit(SIMPLETEST_SCRIPT_EXIT_FAILURE); } diff --git a/core/tests/bootstrap.php b/core/tests/bootstrap.php index 1905f158fda..257e40f9b15 100644 --- a/core/tests/bootstrap.php +++ b/core/tests/bootstrap.php @@ -159,7 +159,7 @@ else { $phpunit_version = Version::id(); } if (!Composer::upgradePHPUnitCheck($phpunit_version)) { - $message = "PHPUnit testing framework version 6 or greater is required when running on PHP 7.2 or greater. Run the command 'composer run-script drupal-phpunit-upgrade' in order to fix this."; + $message = "PHPUnit testing framework version 6 or greater is required when running on PHP 7.0 or greater. Run the command 'composer run-script drupal-phpunit-upgrade' in order to fix this."; echo "\033[31m" . $message . "\n\033[0m"; exit(1); }