Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2bb3f08

Browse files
committed
Fix checks for phpunit releases on Composer 2 (resolves #37601)
1 parent a397c49 commit 2bb3f08

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Symfony/Bridge/PhpUnit/bin/simple-phpunit

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,11 @@ if (!file_exists("$PHPUNIT_DIR/phpunit-$PHPUNIT_VERSION/phpunit") || md5_file(__
117117
'requires' => array('php' => '*'),
118118
);
119119

120-
if (1 === count($info['versions'])) {
120+
$stableVersions = array_filter($info['versions'], function($v) {
121+
return !preg_match('/-dev$|^dev-/', $v);
122+
});
123+
124+
if (!$stableVersions) {
121125
$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.*\"");
122126
} else {
123127
$passthruOrFail("$COMPOSER create-project --ignore-platform-reqs --no-install --prefer-dist --no-scripts --no-plugins --no-progress phpunit/phpunit phpunit-$PHPUNIT_VERSION \"$PHPUNIT_VERSION.*\"");

0 commit comments

Comments
 (0)