Skip to content

Commit 444ab45

Browse files
committed
[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
1 parent d9a7875 commit 444ab45

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

bin/simple-phpunit.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@
231231
}
232232
$prevRoot = getenv('COMPOSER_ROOT_VERSION');
233233
putenv("COMPOSER_ROOT_VERSION=$PHPUNIT_VERSION.99");
234-
$q = '\\' === \DIRECTORY_SEPARATOR ? '"' : '';
234+
$q = '\\' === \DIRECTORY_SEPARATOR && \PHP_VERSION_ID < 80000 ? '"' : '';
235235
// --no-suggest is not in the list to keep compat with composer 1.0, which is shipped with Ubuntu 16.04LTS
236236
$exit = proc_close(proc_open("$q$COMPOSER install --no-dev --prefer-dist --no-progress $q", [], $p, getcwd()));
237237
putenv('COMPOSER_ROOT_VERSION'.(false !== $prevRoot ? '='.$prevRoot : ''));

0 commit comments

Comments
 (0)