Skip to content

Commit 1927e34

Browse files
Merge branch '8.5' into 9.5
2 parents d012222 + ecd93d9 commit 1927e34

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

ChangeLog-8.5.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ All notable changes of the PHPUnit 8.5 release series are documented in this fil
1212
### Fixed
1313

1414
* [#4840](https://github.com/sebastianbergmann/phpunit/pull/4840): TestDox prettifying for class names does not correctly handle diacritics
15+
* [#4846](https://github.com/sebastianbergmann/phpunit/pull/4846): Composer proxy script is not ignored
1516

1617
## [8.5.21] - 2021-09-25
1718

src/Util/GlobalState.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
use function array_keys;
1313
use function array_reverse;
14+
use function array_shift;
1415
use function defined;
1516
use function get_defined_constants;
1617
use function get_included_files;
@@ -23,6 +24,8 @@
2324
use function serialize;
2425
use function sprintf;
2526
use function strpos;
27+
use function strtr;
28+
use function substr;
2629
use function var_export;
2730
use Closure;
2831

@@ -68,7 +71,12 @@ public static function processIncludedFilesAsString(array $files): string
6871
}
6972

7073
// Do not process bootstrap script
71-
unset($files[0]);
74+
array_shift($files);
75+
76+
// If bootstrap script was a Composer bin proxy, skip the second entry as well
77+
if (substr(strtr($files[0], '\\', '/'), -24) === '/phpunit/phpunit/phpunit') {
78+
array_shift($files);
79+
}
7280

7381
foreach (array_reverse($files) as $file) {
7482
if (!empty($GLOBALS['__PHPUNIT_ISOLATION_EXCLUDE_LIST']) &&

0 commit comments

Comments
 (0)