Skip to content

[PhpUnitBridge] Iterate over tests #28481

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

Closed
Closed
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
4 changes: 3 additions & 1 deletion src/Symfony/Bridge/PhpUnit/Legacy/CoverageListenerForV7.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ public function __construct(callable $sutFqcnResolver = null, $warningOnSutNotFo

public function startTestSuite(TestSuite $suite): void
{
$this->trait->startTest($suite);
foreach ($suite->tests() as $test) {
$this->trait->startTest($test);
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An alternate fix would be to implement startTest instead of startTestSuite, not sure why it wasn't done like this in #26089

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And I thought yet another fix would be to let startTrait handle the test suite by completing the if test, but it doesn't work because getAnnotations is called in the trait, and the test suite does not have this method.

Copy link
Member

@nicolas-grekas nicolas-grekas Sep 17, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

implement startTest instead of startTestSuite

let's do that?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure! See #28495, pick whichever you prefer!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be great to have feedback from @lyrixx as to why only the v7 listener uses TestSuite though

}
}