8000 Allow Drupal to wrap the Symfony test listener (5.1 backport) by alexpott · Pull Request #38031 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

Allow Drupal to wrap the Symfony test listener (5.1 backport) #38031

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
8000
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Allow Drupal to wrap the Symfony test listener
  • Loading branch information
fabpot authored and alexpott committed Sep 2, 2020
commit f9bfe7fd79048b0b8e476e3da4af8c26eaf67774
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
namespace Symfony\Bridge\PhpUnit\DeprecationErrorHandler;

use PHPUnit\Util\Test;
use Symfony\Bridge\PhpUnit\Legacy\SymfonyTestsListenerFor;

/**
* @internal
Expand Down Expand Up @@ -61,10 +60,10 @@ public function __construct($message, array $trace, $file)
$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'];
Expand Down
0