fix deprecation triggering test detection
This commit is contained in:
parent
be9382a772
commit
da617e8624
@ -116,8 +116,16 @@ class DeprecationErrorHandler
|
||||
}
|
||||
|
||||
if (isset($trace[$i]['object']) || isset($trace[$i]['class'])) {
|
||||
$class = isset($trace[$i]['object']) ? get_class($trace[$i]['object']) : $trace[$i]['class'];
|
||||
$method = $trace[$i]['function'];
|
||||
if (isset($trace[$i]['class']) && in_array($trace[$i]['class'], array('Symfony\Bridge\PhpUnit\SymfonyTestsListener', 'Symfony\Bridge\PhpUnit\Legacy\SymfonyTestsListener'), true)) {
|
||||
$parsedMsg = unserialize($msg);
|
||||
$msg = $parsedMsg['deprecation'];
|
||||
$class = $parsedMsg['class'];
|
||||
$method = $parsedMsg['method'];
|
||||
} else {
|
||||
$class = isset($trace[$i]['object']) ? get_class($trace[$i]['object']) : $trace[$i]['class'];
|
||||
$method = $trace[$i]['function'];
|
||||
}
|
||||
|
||||
$Test = $UtilPrefix.'Test';
|
||||
|
||||
if (0 !== error_reporting()) {
|
||||
|
@ -264,9 +264,9 @@ class SymfonyTestsListenerTrait
|
||||
unlink($this->runsInSeparateProcess);
|
||||
foreach ($deprecations ? unserialize($deprecations) : array() as $deprecation) {
|
||||
if ($deprecation[0]) {
|
||||
trigger_error($deprecation[1], E_USER_DEPRECATED);
|
||||
trigger_error(serialize(array('deprecation' => $deprecation[1], 'class' => $className, 'method' => $test->getName(false))), E_USER_DEPRECATED);
|
||||
} else {
|
||||
@trigger_error($deprecation[1], E_USER_DEPRECATED);
|
||||
@trigger_error(serialize(array('deprecation' => $deprecation[1], 'class' => $className, 'method' => $test->getName(false))), E_USER_DEPRECATED);
|
||||
}
|
||||
}
|
||||
$this->runsInSeparateProcess = false;
|
||||
|
Reference in New Issue
Block a user