diff --git a/src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler.php b/src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler.php index a7dbc08e0c6c2..1873902cc7954 100644 --- a/src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler.php +++ b/src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler.php @@ -112,7 +112,11 @@ public static function register($mode = 0) $i = count($trace); while (1 < $i && (!isset($trace[--$i]['class']) || ('ReflectionMethod' === $trace[$i]['class'] || 0 === strpos($trace[$i]['class'], 'PHPUnit_') || 0 === strpos($trace[$i]['class'], 'PHPUnit\\')))) { - // No-op + // If the test is run isolation we don't have the actual test class therefore break on the test case + // class because that will have test object. + if (isset($trace[$i]['class']) && ($trace[$i]['class'] === 'PHPUnit_Framework_TestCase' || $trace[$i]['class'] === 'PHPUnit\Framework\TestCase')) { + break; + } } if (isset($trace[$i]['object']) || isset($trace[$i]['class'])) {