Merge branch '5.1'

* 5.1:
  consider traits imported in parent classes
This commit is contained in:
Christian Flothmann 2020-07-09 18:42:07 +02:00
commit 8314762882

View File

@ -232,7 +232,7 @@ class SymfonyTestsListenerTrait
if (isset($annotations['class']['expectedDeprecation'])) {
$test->getTestResultObject()->addError($test, new AssertionFailedError('`@expectedDeprecation` annotations are not allowed at the class level.'), 0);
}
if (isset($annotations['method']['expectedDeprecation']) || $this->checkNumAssertions = \in_array(ExpectDeprecationTrait::class, class_uses($test), true)) {
if (isset($annotations['method']['expectedDeprecation']) || $this->checkNumAssertions = method_exists($test, 'expectDeprecation') && (new \ReflectionMethod($test, 'expectDeprecation'))->getFileName() === (new \ReflectionMethod(ExpectDeprecationTrait::class, 'expectDeprecation'))->getFileName()) {
if (isset($annotations['method']['expectedDeprecation'])) {
self::$expectedDeprecations = $annotations['method']['expectedDeprecation'];
self::$previousErrorHandler = set_error_handler([self::class, 'handleError']);