-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[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
[PhpUnitBridge] Iterate over tests #28481
Conversation
Calling the trait with a TestSuite argument will have no effect, it will exit quickly because of a test added in 25e0117, that checks that $suite is a TestCase instance. Refs symfony#26612
$this->trait->startTest($suite); | ||
foreach ($suite->tests() as $test) { | ||
$this->trait->startTest($test); | ||
} |
There was a problem hiding this comment.
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…
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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!
There was a problem hiding this comment.
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
Is is hard to add a test case for this ? |
The test already exists, what might be needed is a new Travis job with phpunit 7 |
…uite (greg0ire) This PR was merged into the 3.4 branch. Discussion ---------- [PhpUnitBridge] Implement startTest rather than startTestSuite Passing a TestSuite instance to CoverageListenerTrait::testStart() will have no effect. | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes <!-- please add some, will be required by reviewers --> | Fixed tickets | n/a | License | MIT | Doc PR | n/a Closes #28481 Commits ------- 63671d1 Implement startTest rather than startTestSuite
I'm trying to work on a PR for the PHPUnit bridge, but the test suite does not pass when using phpunit 7, so I thought I would start fixing that first.
Calling the trait with a TestSuite argument will have no effect, it will
exit quickly because of a test added in
25e0117, that checks that $suite is a TestCase
instance.
Refs #26612 and #26089
Closes #28495