use Composer\Script\Event;
use Composer\Installer\PackageEvent;
use Composer\Semver\Constraint\Constraint;
+use Composer\Util\ProcessExecutor;
/**
* Provides static functions for composer script events.
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()
* 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);
}
/**
return $package_key;
}
+ /**
+ * Removes Composer's timeout so that scripts can run indefinitely.
+ */
+ public static function removeTimeout() {
+ ProcessExecutor::setTimeout(0);
+ }
+
/**
* Helper method to remove directories and the files they contain.
*