Skip to content

Commit a58c5cf

Browse files
committed
minor #18296 [3.1] fix testing deprecation messages (xabbuh)
This PR was merged into the 3.1-dev branch. Discussion ---------- [3.1] fix testing deprecation messages | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | | License | MIT | Doc PR | * always restore the previous error handler * throw `LogicExcetion` when unexpected error type is triggered Commits ------- 0df544f fix testing deprecation messages
2 parents 999d1c1 + 305d194 commit a58c5cf

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Tests/Templating/TemplateNameParserTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,9 @@ public function testAbsolutePathsAreDeprecated($name, $logicalName, $path, $ref)
9191
$deprecations = array();
9292
set_error_handler(function ($type, $msg) use (&$deprecations) {
9393
if (E_USER_DEPRECATED !== $type) {
94-
throw new \LogicException(sprintf('Unexpected error: "%s".', $msg));
94+
restore_error_handler();
95+
96+
return call_user_func_array('PHPUnit_Util_ErrorHandler::handleError', func_get_args());
9597
}
9698

9799
$deprecations[] = $msg;

0 commit comments

Comments
 (0)