[Bridge/PhpUnit] Fix BC/FC of serialized deprecations
This commit is contained in:
parent
228453b33a
commit
8e473ab06d
@ -125,7 +125,7 @@ class DeprecationErrorHandler
|
||||
// \Symfony\Bridge\PhpUnit\Legacy\SymfonyTestsListenerTrait::endTest()
|
||||
// then we need to use the serialized information to determine
|
||||
// if the error has been triggered from vendor code.
|
||||
$isWeak = DeprecationErrorHandler::MODE_WEAK === $mode || (DeprecationErrorHandler::MODE_WEAK_VENDORS === $mode && $isVendor = $inVendors($parsedMsg['triggering_file']));
|
||||
$isWeak = DeprecationErrorHandler::MODE_WEAK === $mode || (DeprecationErrorHandler::MODE_WEAK_VENDORS === $mode && $isVendor = isset($parsedMsg['triggering_file']) && $inVendors($parsedMsg['triggering_file']));
|
||||
} else {
|
||||
$class = isset($trace[$i]['object']) ? get_class($trace[$i]['object']) : $trace[$i]['class'];
|
||||
$method = $trace[$i]['function'];
|
||||
|
@ -272,7 +272,7 @@ class SymfonyTestsListenerTrait
|
||||
unlink($this->runsInSeparateProcess);
|
||||
putenv('SYMFONY_DEPRECATIONS_SERIALIZE');
|
||||
foreach ($deprecations ? unserialize($deprecations) : array() as $deprecation) {
|
||||
$error = serialize(array('deprecation' => $deprecation[1], 'class' => $className, 'method' => $test->getName(false), 'triggering_file' => $deprecation[2]));
|
||||
$error = serialize(array('deprecation' => $deprecation[1], 'class' => $className, 'method' => $test->getName(false), 'triggering_file' => isset($deprecation[2]) ? $deprecation[2] : null));
|
||||
if ($deprecation[0]) {
|
||||
trigger_error($error, E_USER_DEPRECATED);
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user