Skip to content

Commit

Permalink
Merge branch '10.5' into 11.3
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianbergmann committed Sep 19, 2024
2 parents 40f4e41 + d9a186d commit ca4f132
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
4 changes: 4 additions & 0 deletions ChangeLog-11.3.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes of the PHPUnit 11.3 release series are documented in this fi

## [11.3.6] - 2024-MM-DD

### Changed

* [#5956](https://github.com/sebastianbergmann/phpunit/issues/5956): Deprecation of the `E_STRICT` constant in PHP 8.4

### Fixed

* [#5950](https://github.com/sebastianbergmann/phpunit/pull/5950): TestDox text should not be `trim()`med when it contains `$` character
Expand Down
11 changes: 10 additions & 1 deletion src/Runner/ErrorHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
use function array_keys;
use function array_values;
use function debug_backtrace;
use function defined;
use function error_reporting;
use function restore_error_handler;
use function set_error_handler;
Expand Down Expand Up @@ -85,14 +86,22 @@ public function __invoke(int $errorNumber, string $errorString, string $errorFil
return false;
}

/**
* E_STRICT is deprecated since PHP 8.4.
*
* @see https://github.com/sebastianbergmann/phpunit/issues/5956
*/
if (defined('E_STRICT') && $errorNumber === @E_STRICT) {
$errorNumber = E_NOTICE;
}

$test = Event\Code\TestMethodBuilder::fromCallStack();

$ignoredByBaseline = $this->ignoredByBaseline($errorFile, $errorLine, $errorString);
$ignoredByTest = $test->metadata()->isIgnoreDeprecations()->isNotEmpty();

switch ($errorNumber) {
case E_NOTICE:
case E_STRICT:
Event\Facade::emitter()->testTriggeredPhpNotice(
$test,
$errorString,
Expand Down

0 comments on commit ca4f132

Please # to comment.