Skip to content

[PhpUnitBridge] fix dumping tests to skip with data providers #58828

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
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 @@ -13,6 +13,7 @@

use Doctrine\Common\Annotations\AnnotationRegistry;
use PHPUnit\Framework\AssertionFailedError;
use PHPUnit\Framework\DataProviderTestSuite;
use PHPUnit\Framework\RiskyTestError;
use PHPUnit\Framework\TestCase;
use PHPUnit\Framework\TestSuite;
Expand Down Expand Up @@ -196,7 +197,13 @@
public function addSkippedTest($test, \Exception $e, $time)
{
if (0 < $this->state) {
$this->isSkipped[\get_class($test)][$test->getName()] = 1;
if ($test instanceof DataProviderTestSuite) {
foreach ($test->tests() as $testWithDataProvider) {
$this->isSkipped[\get_class($testWithDataProvider)][$testWithDataProvider->getName()] = 1;

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

View workflow job for this annotation

GitHub Actions / Psalm

UndefinedInterfaceMethod

src/Symfony/Bridge/PhpUnit/Legacy/SymfonyTestsListenerTrait.php:202:96: UndefinedInterfaceMethod: Method PHPUnit\Framework\Test::getName does not exist (see https://psalm.dev/181)

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

View workflow job for this annotation

GitHub Actions / Psalm

UndefinedInterfaceMethod

src/Symfony/Bridge/PhpUnit/Legacy/SymfonyTestsListenerTrait.php:202:96: UndefinedInterfaceMethod: Method PHPUnit\Framework\Test::getName does not exist (see https://psalm.dev/181)
}
} else {
$this->isSkipped[\get_class($test)][$test->getName()] = 1;
}
}
}

Expand Down
Loading