8000 bug #38031 Allow Drupal to wrap the Symfony test listener (5.1 backpo… · symfony/symfony@a36c43b · GitHub
[go: up one dir, main page]

Skip to content

Commit a36c43b

Browse files
committed
bug #38031 Allow Drupal to wrap the Symfony test listener (5.1 backport) (fabpot, alexpott)
This PR was merged into the 5.1 branch. Discussion ---------- Allow Drupal to wrap the Symfony test listener (5.1 backport) | Q | A | ------------- | --- | Branch? | 5.1 | Bug fix? | kinda | New feature? | no | Deprecations? | no | Tickets | Fix #... <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead --> | License | MIT | Doc PR | symfony/symfony-docs#... <!-- required for new features --> This is a backport of #37708 Commits ------- 244e8d2 Revert "Swallow errors" ee8cc26 Swallow errors f9bfe7f Allow Drupal to wrap the Symfony test listener
2 parents a9c93fc + 244e8d2 commit a36c43b

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler/Deprecation.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
namespace Symfony\Bridge\PhpUnit\DeprecationErrorHandler;
1313

1414
use PHPUnit\Util\Test;
15-
use Symfony\Bridge\PhpUnit\Legacy\SymfonyTestsListenerFor;
1615

1716
/**
1817
* @internal
@@ -61,10 +60,10 @@ public function __construct($message, array $trace, $file)
6160
$line = $trace[$i];
6261
$this->triggeringFile = $file;
6362
if (isset($line['object']) || isset($line['class'])) {
64-
if (isset($line['class']) && 0 === strpos($line['class'], SymfonyTestsListenerFor::class)) {
65-
set_error_handler(function () {});
66-
$parsedMsg = unserialize($this->message);
67-
restore_error_handler();
63+
set_error_handler(function () {});
64+
$parsedMsg = unserialize($this->message);
65+
restore_error_handler();
66+
if ($parsedMsg && isset($parsedMsg['deprecation'])) {
6867
$this->message = $parsedMsg['deprecation'];
6968
$this->originClass = $parsedMsg['class'];
7069
$this->originMethod = $parsedMsg['method'];

0 commit comments

Comments
 (0)
0