Skip to content

Commit d6fa3dd

Browse files
committed
fix testing deprecation messages
* always restore the previous error handler * throw `LogicExcetion` when unexpected error type is triggered
1 parent 38aebd1 commit d6fa3dd

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Tests/InlineTest.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -260,9 +260,13 @@ public function testParseUnquotedScalarStartingWithPercentCharacter()
260260
{
261261
$deprecations = array();
262262
set_error_handler(function ($type, $msg) use (&$deprecations) {
263-
if (E_USER_DEPRECATED === $type) {
264-
$deprecations[] = $msg;
263+
if (E_USER_DEPRECATED !== $type) {
264+
restore_error_handler();
265+
266+
return call_user_func_array('PHPUnit_Util_ErrorHandler::handleError', func_get_args());
265267
}
268+
269+
$deprecations[] = $msg;
266270
});
267271

268272
Inline::parse('{ foo: %foo }');

0 commit comments

Comments
 (0)