Skip to content

Commit

Permalink
Fix checks for phpunit releases on Composer 2 (resolves #37601)
Browse files Browse the repository at this point in the history
  • Loading branch information
colinodell committed Jul 22, 2020
1 parent c0f8b42 commit 03f8311
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion bin/simple-phpunit
Original file line number Diff line number Diff line change
Expand Up @@ -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.*\"");
Expand Down

0 comments on commit 03f8311

Please sign in to comment.