From c101259192c46405d5b3d91f855d0446220fecc5 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Wed, 20 May 2020 23:58:15 +0200 Subject: [PATCH 1/2] [PhpUnitBridge] fix installing on PHP 8 (bis) --- src/Symfony/Bridge/PhpUnit/bin/simple-phpunit | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Symfony/Bridge/PhpUnit/bin/simple-phpunit b/src/Symfony/Bridge/PhpUnit/bin/simple-phpunit index bf4fbb0c28..67dcfbef6c 100755 --- a/src/Symfony/Bridge/PhpUnit/bin/simple-phpunit +++ b/src/Symfony/Bridge/PhpUnit/bin/simple-phpunit @@ -89,7 +89,7 @@ if (!file_exists("$PHPUNIT_DIR/phpunit-$PHPUNIT_VERSION/phpunit") || md5_file(__ } $info = array(); - foreach (explode("\n", `$COMPOSER info -a -n phpunit/phpunit "$PHPUNIT_VERSION.*"`) as $line) { + foreach (explode("\n", `$COMPOSER info --no-ansi -a -n phpunit/phpunit "$PHPUNIT_VERSION.*"`) as $line) { $line = rtrim($line); if (!$info && preg_match('/^versions +: /', $line)) { From 5ec5bfb23c304f536c2f9d33b8f1eed3d712891f Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Thu, 21 May 2020 00:01:37 +0200 Subject: [PATCH 2/2] [PhpUnitBridge] fix installing on PHP 8 (ter) --- src/Symfony/Bridge/PhpUnit/bin/simple-phpunit | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Bridge/PhpUnit/bin/simple-phpunit b/src/Symfony/Bridge/PhpUnit/bin/simple-phpunit index 67dcfbef6c..e416a23a59 100755 --- a/src/Symfony/Bridge/PhpUnit/bin/simple-phpunit +++ b/src/Symfony/Bridge/PhpUnit/bin/simple-phpunit @@ -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\"");