Skip to content

Commit 305d194

Browse files
committed
fix testing deprecation messages
* always restore the previous error handler * throw `LogicExcetion` when unexpected error type is triggered
1 parent 6ee4a54 commit 305d194

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)