Skip to content

Commit 179b307

Browse files
Merge branch '7.4' into 8.0
* 7.4: [HttpKernel] Add `#[IsSignatureValid]` attribute Introduce `twig-cs-fixer` [HttpFoundation] Handle error when directory is a file [FrameworkBundle] Add KernelBrowser::getSession() [Serializer] Allows to instantiate property when creating a `NotNormalizableValueException` do not support sensitive option entries [HttpKernel] Refine ControllerEvent::getAttributes() and ControllerArgumentsEvent::getAttributes() return types do not try to modify the result of a PhptTestCase update the PHPUnit configuration [Lock] Fix package name for DynamoDB [Lock] DynamoDB store [Console][QuestionHelper] add optional timeout for human interaction [Messenger] Introduce `DefaultStampsProviderInterface ` [TwigBridge] Call form_label_content block inside button_widget block [Config] Add argument $singular to NodeBuilder::arrayNode() to decouple plurals/singulars from XML chore(http-foundation): add better type information using phpdoc
2 parents 72d301a + 748c45e commit 179b307

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Legacy/SymfonyTestsListenerTrait.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -271,9 +271,9 @@ public function endTest($test, $time): void
271271

272272
if ($this->checkNumAssertions) {
273273
$assertions = \count(self::$expectedDeprecations) + $test->getNumAssertions();
274-
if ($test->doesNotPerformAssertions() && $assertions > 0) {
274+
if ($test instanceof TestCase && $test->doesNotPerformAssertions() && $assertions > 0) {
275275
$test->getTestResultObject()->addFailure($test, new RiskyTestError(\sprintf('This test is annotated with "@doesNotPerformAssertions", but performed %s assertions', $assertions)), $time);
276-
} elseif (0 === $assertions && !$test->doesNotPerformAssertions() && $test->getTestResultObject()->noneSkipped()) {
276+
} elseif ($test instanceof TestCase && 0 === $assertions && !$test->doesNotPerformAssertions() && $test->getTestResultObject()->noneSkipped()) {
277277
$test->getTestResultObject()->addFailure($test, new RiskyTestError('This test did not perform any assertions'), $time);
278278
}
279279

@@ -303,9 +303,9 @@ public function endTest($test, $time): void
303303

304304
restore_error_handler();
305305

306-
if (!\in_array('legacy', $groups, true)) {
306+
if ($test instanceof TestCase && !\in_array('legacy', $groups, true)) {
307307
$test->getTestResultObject()->addError($test, new AssertionFailedError('Only tests with the "@group legacy" annotation can expect a deprecation.'), 0);
308-
} elseif (!\in_array($test->getStatus(), [BaseTestRunner::STATUS_SKIPPED, BaseTestRunner::STATUS_INCOMPLETE, BaseTestRunner::STATUS_FAILURE, BaseTestRunner::STATUS_ERROR], true)) {
308+
} elseif ($test instanceof TestCase && !\in_array($test->getStatus(), [BaseTestRunner::STATUS_SKIPPED, BaseTestRunner::STATUS_INCOMPLETE, BaseTestRunner::STATUS_FAILURE, BaseTestRunner::STATUS_ERROR], true)) {
309309
try {
310310
$prefix = "@expectedDeprecation:\n";
311311
$test->assertStringMatchesFormat($prefix.'%A '.implode("\n%A ", self::$expectedDeprecations)."\n%A", $prefix.' '.implode("\n ", self::$gatheredDeprecations)."\n");

0 commit comments

Comments
 (0)