Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -280,9 +280,9 @@

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

Expand Down Expand Up @@ -312,9 +312,9 @@

restore_error_handler();

if (!\in_array('legacy', $groups, true)) {
if ($test instanceof TestCase && !\in_array('legacy', $groups, true)) {
$test->getTestResultObject()->addError($test, new AssertionFailedError('Only tests with the "@group legacy" annotation can expect a deprecation.'), 0);
} elseif (!\in_array($test->getStatus(), [BaseTestRunner::STATUS_SKIPPED, BaseTestRunner::STATUS_INCOMPLETE, BaseTestRunner::STATUS_FAILURE, BaseTestRunner::STATUS_ERROR], true)) {
} elseif ($test instanceof TestCase && !\in_array($test->getStatus(), [BaseTestRunner::STATUS_SKIPPED, BaseTestRunner::STATUS_INCOMPLETE, BaseTestRunner::STATUS_FAILURE, BaseTestRunner::STATUS_ERROR], true)) {
try {
$prefix = "@expectedDeprecation:\n";
$test->assertStringMatchesFormat($prefix.'%A '.implode("\n%A ", self::$expectedDeprecations)."\n%A", $prefix.' '.implode("\n ", self::$gatheredDeprecations)."\n");
Expand All @@ -328,7 +328,7 @@
}
if (!$this->runsInSeparateProcess && -2 < $this->state && $test instanceof TestCase) {
if (\in_array('time-sensitive', $groups, true)) {
ClockMock::withClockMock(false);

Check failure on line 331 in src/Symfony/Bridge/PhpUnit/Legacy/SymfonyTestsListenerTrait.php

View workflow job for this annotation

GitHub Actions / Psalm

UndefinedClass

src/Symfony/Bridge/PhpUnit/Legacy/SymfonyTestsListenerTrait.php:331:17: UndefinedClass: Class, interface or enum named Symfony\Bridge\PhpUnit\ClockMock does not exist (see https://psalm.dev/019)

Check failure on line 331 in src/Symfony/Bridge/PhpUnit/Legacy/SymfonyTestsListenerTrait.php

View workflow job for this annotation

GitHub Actions / Psalm

UndefinedClass

src/Symfony/Bridge/PhpUnit/Legacy/SymfonyTestsListenerTrait.php:331:17: UndefinedClass: Class, interface or enum named Symfony\Bridge\PhpUnit\ClockMock does not exist (see https://psalm.dev/019)
}
if (\in_array('dns-sensitive', $groups, true)) {
DnsMock::withMockedHosts([]);
Expand Down
Loading