From 4b958917fd06a957370c0582ebd3960ef6ccde37 Mon Sep 17 00:00:00 2001 From: Fabien Villepinte Date: Sat, 31 Oct 2020 13:49:56 +0000 Subject: [PATCH] [PHPUnitBridge] Fixed crash on Windows with PHP 8 The install command crashed with the message "The filename, directory name, or volume label syntax is incorrect.". It happens only on Windows with PHP 8. Probably due to https://github.com/php/php-src/blob/PHP-8.0/UPGRADING#L1121-L1123 --- src/Symfony/Bridge/PhpUnit/bin/simple-phpunit.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Symfony/Bridge/PhpUnit/bin/simple-phpunit.php b/src/Symfony/Bridge/PhpUnit/bin/simple-phpunit.php index 08be74fc72..7cfd6665d1 100644 --- a/src/Symfony/Bridge/PhpUnit/bin/simple-phpunit.php +++ b/src/Symfony/Bridge/PhpUnit/bin/simple-phpunit.php @@ -231,7 +231,7 @@ if (!file_exists("$PHPUNIT_DIR/$PHPUNIT_VERSION_DIR/phpunit") || $configurationH } $prevRoot = getenv('COMPOSER_ROOT_VERSION'); putenv("COMPOSER_ROOT_VERSION=$PHPUNIT_VERSION.99"); - $q = '\\' === \DIRECTORY_SEPARATOR ? '"' : ''; + $q = '\\' === \DIRECTORY_SEPARATOR && \PHP_VERSION_ID < 80000 ? '"' : ''; // --no-suggest is not in the list to keep compat with composer 1.0, which is shipped with Ubuntu 16.04LTS $exit = proc_close(proc_open("$q$COMPOSER install --no-dev --prefer-dist --no-progress $q", [], $p, getcwd())); putenv('COMPOSER_ROOT_VERSION'.(false !== $prevRoot ? '='.$prevRoot : ''));