Skip to content

Commit

Permalink
Closes #4033
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianbergmann committed May 22, 2020
1 parent 59a3636 commit a153fda
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
7 changes: 7 additions & 0 deletions ChangeLog-8.5.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

All notable changes of the PHPUnit 8.5 release series are documented in this file using the [Keep a CHANGELOG](https://keepachangelog.com/) principles.

## [8.5.5] - 2020-MM-DD

### Fixed

* [#4033](https://github.com/sebastianbergmann/phpunit/issues/4033: Unexpected behaviour when `$GLOBALS` is deleted

## [8.5.4] - 2020-04-23

### Changed
Expand Down Expand Up @@ -52,6 +58,7 @@ All notable changes of the PHPUnit 8.5 release series are documented in this fil
* [#3967](https://github.com/sebastianbergmann/phpunit/issues/3967): Cannot double interface that extends interface that extends `\Throwable`
* [#3968](https://github.com/sebastianbergmann/phpunit/pull/3968): Test class run in a separate PHP process are passing when `exit` called inside

[8.5.5]: https://github.com/sebastianbergmann/phpunit/compare/8.5.4...8.5.5
[8.5.4]: https://github.com/sebastianbergmann/phpunit/compare/8.5.3...8.5.4
[8.5.3]: https://github.com/sebastianbergmann/phpunit/compare/8.5.2...8.5.3
[8.5.2]: https://github.com/sebastianbergmann/phpunit/compare/8.5.1...8.5.2
Expand Down
8 changes: 7 additions & 1 deletion src/Util/Filter.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,13 @@ private static function shouldPrintFrame($frame, $prefix, Blacklist $blacklist):

$file = $frame['file'];
$fileIsNotPrefixed = $prefix === false || \strpos($file, $prefix) !== 0;
$script = \realpath($GLOBALS['_SERVER']['SCRIPT_NAME']);

// @see https://github.com/sebastianbergmann/phpunit/issues/4033
if (isset($GLOBALS['_SERVER']['SCRIPT_NAME'])) {
$script = \realpath($GLOBALS['_SERVER']['SCRIPT_NAME']);
} else {
$script = '';
}

return \is_file($file) &&
self::fileIsBlacklisted($file, $blacklist) &&
Expand Down

0 comments on commit a153fda

Please sign in to comment.