Skip to content

Commit 4e7f3c2

Browse files
committed
Test bootstrap: tweak the version determination regex
Apparently, Composer 2.3.0 dropped the word `version` from the `--version` output ;-) Output on Composer 2.2 and lower: ``` Composer version 2.2.10 2022-03-29 21:55:35 ``` Composer 2.3 output: ``` Composer 2.3.0 2022-03-30 11:15:36 ```
1 parent fc4e33e commit 4e7f3c2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tests/bootstrap.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@
114114
// Get the version of Composer being used.
115115
$command = '"' . \PHP_BINARY . '" "' . \COMPOSER_PHAR . '" --version --no-ansi --no-interaction';
116116
$lastLine = exec($command, $output, $exitcode);
117-
if ($exitcode === 0 && preg_match('`Composer version ([^\s]+)`', $lastLine, $matches) === 1) {
117+
if ($exitcode === 0 && preg_match('`Composer (?:version )([^\s]+)`', $lastLine, $matches) === 1) {
118118
define('COMPOSER_VERSION', $matches[1]);
119119
} else {
120120
echo 'Could not determine the version of Composer being used.';

0 commit comments

Comments
 (0)