[PhpUnitBridge] fix compat with symfony/debug
This commit is contained in:
parent
a78fb1832b
commit
35dd54a654
@ -11,6 +11,8 @@
|
||||
|
||||
namespace Symfony\Bridge\PhpUnit\DeprecationErrorHandler;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use PHPUnit\Framework\TestSuite;
|
||||
use PHPUnit\Util\Test;
|
||||
use Symfony\Bridge\PhpUnit\Legacy\SymfonyTestsListenerFor;
|
||||
use Symfony\Component\Debug\DebugClassLoader as LegacyDebugClassLoader;
|
||||
@ -82,7 +84,10 @@ class Deprecation
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($line['object']) || isset($line['class'])) {
|
||||
if (!isset($line['object']) && !isset($line['class'])) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!isset($line['class'], $trace[$i - 2]['function']) || 0 !== strpos($line['class'], SymfonyTestsListenerFor::class)) {
|
||||
$this->originClass = isset($line['object']) ? \get_class($line['object']) : $line['class'];
|
||||
$this->originMethod = $line['function'];
|
||||
@ -90,7 +95,9 @@ class Deprecation
|
||||
return;
|
||||
}
|
||||
|
||||
if ('trigger_error' !== $trace[$i - 2]['function'] || isset($trace[$i - 2]['class'])) {
|
||||
$test = isset($line['args'][0]) ? $line['args'][0] : null;
|
||||
|
||||
if (($test instanceof TestCase || $test instanceof TestSuite) && ('trigger_error' !== $trace[$i - 2]['function'] || isset($trace[$i - 2]['class']))) {
|
||||
$this->originClass = \get_class($line['args'][0]);
|
||||
$this->originMethod = $line['args'][0]->getName();
|
||||
|
||||
@ -114,7 +121,6 @@ class Deprecation
|
||||
$this->triggeringFile = $parsedMsg['triggering_file'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
|
Reference in New Issue
Block a user