Issue #2932606 by jibran, mpdonadio, alexpott, catch: Use PHPUnit 6 for PHP 7.0 / 7.1 testing

merge-requests/1654/head
Nathaniel Catchpole 2018-04-03 12:41:33 +01:00
parent eecd757072
commit 065807745f
3 changed files with 4 additions and 4 deletions

View File

@ -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);
}
/**

View File

@ -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);
}

View File

@ -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);
}