Skip to content

Commit

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

## [10.5.35] - 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 @@ -24,6 +24,7 @@
use const E_USER_NOTICE;
use const E_USER_WARNING;
use const E_WARNING;
use function defined;
use function error_reporting;
use function restore_error_handler;
use function set_error_handler;
Expand Down Expand Up @@ -63,14 +64,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 d9a186d

Please sign in to comment.