Skip to content

Commit

Permalink
[PhpUnitBridge] fix installing on PHP 8 (ter)
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolas-grekas committed May 20, 2020
1 parent c101259 commit 5ec5bfb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Symfony/Bridge/PhpUnit/bin/simple-phpunit
Expand Up @@ -121,8 +121,10 @@ if (!file_exists("$PHPUNIT_DIR/phpunit-$PHPUNIT_VERSION/phpunit") || md5_file(__
$passthruOrFail("$COMPOSER require --no-update phpunit/phpunit-mock-objects \"~3.1.0\"");
}

if (preg_match('{\^(\d++\.\d++)[\d\.]*)$}', $info['requires']['php'], $phpVersion)) {
if (preg_match('{\^(\d++\.\d++)[\d\.]*$}', $info['requires']['php'], $phpVersion) && version_compare($phpVersion[1], PHP_VERSION, '<')) {
$passthruOrFail("$COMPOSER config platform.php \"$phpVersion[1].99\"");
} else {
$passthruOrFail("$COMPOSER config --unset platform.php");
}
if (file_exists($path = $root.'/vendor/symfony/phpunit-bridge')) {
$passthruOrFail("$COMPOSER require --no-update symfony/phpunit-bridge \"*@dev\"");
Expand Down

0 comments on commit 5ec5bfb

Please sign in to comment.