Skip to content

Commit

Permalink
Fix GlobalState collection to ignore the Composer proxy
Browse files Browse the repository at this point in the history
  • Loading branch information
Seldaek authored and sebastianbergmann committed Dec 23, 2021
1 parent 23a8b14 commit 05def51
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/Util/GlobalState.php
Expand Up @@ -67,7 +67,14 @@ public static function processIncludedFilesAsString(array $files): string
$prefix = 'phar://' . __PHPUNIT_PHAR__ . '/';
}

for ($i = count($files) - 1; $i > 0; $i--) {
// Do not process bootstrap script
array_shift($files);
// If bootstrap script was a Composer bin proxy, skip the second entry as well
if (substr(strtr($files[0], '\\', '/'), -24) === '/phpunit/phpunit/phpunit') {
array_shift($files);
}

for ($i = count($files) - 1; $i >= 0; $i--) {
$file = $files[$i];

if (!empty($GLOBALS['__PHPUNIT_ISOLATION_BLACKLIST']) &&
Expand Down

0 comments on commit 05def51

Please sign in to comment.