From a153fda91b9d95b10c83c71b334a00696f8679bf Mon Sep 17 00:00:00 2001 From: Sebastian Bergmann Date: Fri, 22 May 2020 10:19:17 +0200 Subject: [PATCH] Closes #4033 --- ChangeLog-8.5.md | 7 +++++++ src/Util/Filter.php | 8 +++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/ChangeLog-8.5.md b/ChangeLog-8.5.md index b805c844097..ef099799f22 100644 --- a/ChangeLog-8.5.md +++ b/ChangeLog-8.5.md @@ -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 @@ -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 diff --git a/src/Util/Filter.php b/src/Util/Filter.php index 7fd8050499a..d1a8ec64fd8 100644 --- a/src/Util/Filter.php +++ b/src/Util/Filter.php @@ -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) &&