File tree Expand file tree Collapse file tree 1 file changed +11
-7
lines changed
Filter options
src/Symfony/Bridge/PhpUnit Expand file tree Collapse file tree 1 file changed +11
-7
lines changed
Original file line number Diff line number Diff line change @@ -367,22 +367,26 @@ private static function getPhpUnitErrorHandler(): callable
367
367
368
368
if ('PHPUnit\Util\ErrorHandler::handleError ' === $ eh ) {
369
369
return $ eh ;
370
- } elseif (ErrorHandler::class === $ eh ) {
371
- return function (int $ errorNumber , string $ errorString , string $ errorFile , int $ errorLine ) {
372
- ErrorHandler::instance ()($ errorNumber , $ errorString , $ errorFile , $ errorLine );
373
-
374
- return true ;
375
- };
376
370
}
377
371
378
372
foreach (debug_backtrace (\DEBUG_BACKTRACE_PROVIDE_OBJECT | \DEBUG_BACKTRACE_IGNORE_ARGS ) as $ frame ) {
379
- if (isset ($ frame ['object ' ]) && $ frame ['object ' ] instanceof TestResult) {
373
+ if (!isset ($ frame ['object ' ])) {
374
+ continue ;
375
+ }
376
+
377
+ if ($ frame ['object ' ] instanceof TestResult) {
380
378
return new $ eh (
381
379
$ frame ['object ' ]->getConvertDeprecationsToExceptions (),
382
380
$ frame ['object ' ]->getConvertErrorsToExceptions (),
383
381
$ frame ['object ' ]->getConvertNoticesToExceptions (),
384
382
$ frame ['object ' ]->getConvertWarningsToExceptions ()
385
383
);
384
+ } elseif (ErrorHandler::class === $ eh && $ frame ['object ' ] instanceof TestCase) {
385
+ return function (int $ errorNumber , string $ errorString , string $ errorFile , int $ errorLine ) {
386
+ ErrorHandler::instance ()($ errorNumber , $ errorString , $ errorFile , $ errorLine );
387
+
388
+ return true ;
389
+ };
386
390
}
387
391
}
388
392
You can’t perform that action at this time.
0 commit comments