Skip to content

Commit 392eff4

Browse files
[PhpUnitBridge] fix installing on PHP 8 (ter)
1 parent 763063d commit 392eff4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

bin/simple-phpunit

+3-1
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,10 @@ if (!file_exists("$PHPUNIT_DIR/phpunit-$PHPUNIT_VERSION/phpunit") || md5_file(__
121121
$passthruOrFail("$COMPOSER require --no-update phpunit/phpunit-mock-objects \"~3.1.0\"");
122122
}
123123

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

0 commit comments

Comments
 (0)