diff --git a/src/Util/GlobalState.php b/src/Util/GlobalState.php index 6577faf89e6..5f483f30163 100644 --- a/src/Util/GlobalState.php +++ b/src/Util/GlobalState.php @@ -10,6 +10,7 @@ namespace PHPUnit\Util; use function array_keys; +use function array_shift; use function count; use function defined; use function get_defined_constants; @@ -23,6 +24,8 @@ use function serialize; use function sprintf; use function strpos; +use function strtr; +use function substr; use function var_export; use Closure; @@ -69,6 +72,7 @@ public static function processIncludedFilesAsString(array $files): string // 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);