Fix checks for phpunit releases on Composer 2 (resolves #37601)

This commit is contained in:
Colin O'Dell 2020-07-19 09:57:33 -04:00
parent a397c490b0
commit 2bb3f08fba
No known key found for this signature in database
GPG Key ID: 60A4DAD272A01CB8
1 changed files with 5 additions and 1 deletions

View File

@ -117,7 +117,11 @@ if (!file_exists("$PHPUNIT_DIR/phpunit-$PHPUNIT_VERSION/phpunit") || md5_file(__
'requires' => array('php' => '*'),
);
if (1 === count($info['versions'])) {
$stableVersions = array_filter($info['versions'], function($v) {
return !preg_match('/-dev$|^dev-/', $v);
});
if (!$stableVersions) {
$passthruOrFail("$COMPOSER create-project --ignore-platform-reqs --no-install --prefer-dist --no-scripts --no-plugins --no-progress -s dev phpunit/phpunit phpunit-$PHPUNIT_VERSION \"$PHPUNIT_VERSION.*\"");
} else {
$passthruOrFail("$COMPOSER create-project --ignore-platform-reqs --no-install --prefer-dist --no-scripts --no-plugins --no-progress phpunit/phpunit phpunit-$PHPUNIT_VERSION \"$PHPUNIT_VERSION.*\"");