diff --git a/src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler.php b/src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler.php index 7cccd8eb83..e9c8d19d8f 100644 --- a/src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler.php +++ b/src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler.php @@ -140,7 +140,7 @@ class DeprecationErrorHandler $Test = $UtilPrefix.'Test'; - if (0 !== error_reporting()) { + if (error_reporting() & $type) { $group = 'unsilenced'; } elseif (0 === strpos($method, 'testLegacy') || 0 === strpos($method, 'provideLegacy') @@ -292,7 +292,7 @@ class DeprecationErrorHandler return \call_user_func(DeprecationErrorHandler::getPhpUnitErrorHandler(), $type, $msg, $file, $line, $context); } - $deprecations[] = array(error_reporting(), $msg, $file); + $deprecations[] = array(error_reporting() & $type, $msg, $file); return null; }); diff --git a/src/Symfony/Bridge/PhpUnit/Legacy/SymfonyTestsListenerTrait.php b/src/Symfony/Bridge/PhpUnit/Legacy/SymfonyTestsListenerTrait.php index ee9378d140..b6d05cb0f1 100644 --- a/src/Symfony/Bridge/PhpUnit/Legacy/SymfonyTestsListenerTrait.php +++ b/src/Symfony/Bridge/PhpUnit/Legacy/SymfonyTestsListenerTrait.php @@ -352,7 +352,7 @@ class SymfonyTestsListenerTrait if (\is_array($parsedMsg)) { $msg = $parsedMsg['deprecation']; } - if (error_reporting()) { + if (error_reporting() & $type) { $msg = 'Unsilenced deprecation: '.$msg; } $this->gatheredDeprecations[] = $msg;