From ada8ab80f7e9d19da7304023aeaa9e50c69d731d Mon Sep 17 00:00:00 2001 From: Michal Kruczek Date: Wed, 29 Jun 2022 12:08:38 +0200 Subject: [PATCH] fixes circular dependency issue at zf1s/zf1 when composer2 is used --- PHPUnit/Util/GlobalState.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/PHPUnit/Util/GlobalState.php b/PHPUnit/Util/GlobalState.php index 7065a0d7480..f55ab9b4366 100644 --- a/PHPUnit/Util/GlobalState.php +++ b/PHPUnit/Util/GlobalState.php @@ -197,6 +197,13 @@ public static function getIncludedFilesAsString() if (defined('__PHPUNIT_PHAR__')) { $prefix = 'phar://' . __PHPUNIT_PHAR__ . '/'; } + + // Do not process bootstrap script - composer v2 compatibility + // https://github.com/composer/composer/issues/10387#issuecomment-1002942296 + // https://github.com/sebastianbergmann/phpunit/pull/4846 + while (strpos($files[0], 'bin/phpunit') !== false) { + array_shift($files); + } for ($i = count($files) - 1; $i > 0; $i--) { $file = $files[$i];