From 444ab4566559d519bd307e93511168f5e9dbc214 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 --- bin/simple-phpunit.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/simple-phpunit.php b/bin/simple-phpunit.php index 08be74fc..7cfd6665 100644 --- a/bin/simple-phpunit.php +++ b/bin/simple-phpunit.php @@ -231,7 +231,7 @@ } $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 : ''));