Skip to content

Commit 6a4aa15

Browse files
[PhpUnitBridge] fix bad detection of unsilenced deprecations
1 parent a8ba270 commit 6a4aa15

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

DeprecationErrorHandler.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ public static function register($mode = 0)
140140

141141
$Test = $UtilPrefix.'Test';
142142

143-
if (0 !== error_reporting()) {
143+
if (error_reporting() & $type) {
144144
$group = 'unsilenced';
145145
} elseif (0 === strpos($method, 'testLegacy')
146146
|| 0 === strpos($method, 'provideLegacy')
@@ -292,7 +292,7 @@ public static function collectDeprecations($outputFile)
292292

293293
return \call_user_func(DeprecationErrorHandler::getPhpUnitErrorHandler(), $type, $msg, $file, $line, $context);
294294
}
295-
$deprecations[] = array(error_reporting(), $msg, $file);
295+
$deprecations[] = array(error_reporting() & $type, $msg, $file);
296296

297297
return null;
298298
});

Legacy/SymfonyTestsListenerTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ public function handleError($type, $msg, $file, $line, $context = array())
352352
if (\is_array($parsedMsg)) {
353353
$msg = $parsedMsg['deprecation'];
354354
}
355-
if (error_reporting()) {
355+
if (error_reporting() & $type) {
356356
$msg = 'Unsilenced deprecation: '.$msg;
357357
}
358358
$this->gatheredDeprecations[] = $msg;

0 commit comments

Comments
 (0)