From 9b9e823ca54459edbcfd394d528df0aabee2ff09 Mon Sep 17 00:00:00 2001 From: jrfnl Date: Wed, 30 Mar 2022 15:07:19 +0200 Subject: [PATCH] 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 ``` --- tests/bootstrap.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/bootstrap.php b/tests/bootstrap.php index 52c18a2a..67ae4650 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -114,7 +114,7 @@ // Get the version of Composer being used. $command = '"' . \PHP_BINARY . '" "' . \COMPOSER_PHAR . '" --version --no-ansi --no-interaction'; $lastLine = exec($command, $output, $exitcode); -if ($exitcode === 0 && preg_match('`Composer version ([^\s]+)`', $lastLine, $matches) === 1) { +if ($exitcode === 0 && preg_match('`Composer (?:version )?([^\s]+)`', $lastLine, $matches) === 1) { define('COMPOSER_VERSION', $matches[1]); } else { echo 'Could not determine the version of Composer being used.';