Allow Drupal to wrap the Symfony test listener

This commit is contained in:
Fabien Potencier 2020-08-23 19:24:34 +02:00 committed by Alex Pott
parent a9c93fc094
commit f9bfe7fd79
No known key found for this signature in database
GPG Key ID: 31905460D4A69276

View File

@ -12,7 +12,6 @@
namespace Symfony\Bridge\PhpUnit\DeprecationErrorHandler;
use PHPUnit\Util\Test;
use Symfony\Bridge\PhpUnit\Legacy\SymfonyTestsListenerFor;
/**
* @internal
@ -61,10 +60,10 @@ class Deprecation
$line = $trace[$i];
$this->triggeringFile = $file;
if (isset($line['object']) || isset($line['class'])) {
if (isset($line['class']) && 0 === strpos($line['class'], SymfonyTestsListenerFor::class)) {
set_error_handler(function () {});
$parsedMsg = unserialize($this->message);
restore_error_handler();
set_error_handler(function () {});
$parsedMsg = unserialize($this->message);
restore_error_handler();
if ($parsedMsg && isset($parsedMsg['deprecation'])) {
$this->message = $parsedMsg['deprecation'];
$this->originClass = $parsedMsg['class'];
$this->originMethod = $parsedMsg['method'];