Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion PHPUnit/Util/GlobalState.php
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,20 @@ public static function phpunitFiles()
if (self::$phpunitFiles === NULL) {
self::$phpunitFiles = array();
self::addDirectoryContainingClassToPHPUnitFilesList('File_Iterator');
self::addDirectoryContainingClassToPHPUnitFilesList('PHP_CodeCoverage');
// phpunitFiles() collects directories of PHPUnit's internal packages
// to exclude them from stack traces and from the list of included files
// when running tests in separate processes.
//
// When code coverage is enabled, TestRunner loads PHP_CodeCoverage
// before any tests run, so class_exists() returns true here.
// When coverage is off, the class is not loaded and its directory
// does not need to be excluded from anything.
//
// Check without autoloading (false) to avoid triggering implicit
// nullable deprecation from php-code-coverage on php 8.4.
if (class_exists('PHP_CodeCoverage', false)) {
self::addDirectoryContainingClassToPHPUnitFilesList('PHP_CodeCoverage');
}
self::addDirectoryContainingClassToPHPUnitFilesList('PHP_Invoker');
self::addDirectoryContainingClassToPHPUnitFilesList('PHP_Timer');
self::addDirectoryContainingClassToPHPUnitFilesList('PHP_Token');
Expand Down
Loading