Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[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

Conversation

greg0ire
Copy link
Contributor

@greg0ire greg0ire commented Sep 16, 2018

Q A
Branch? 3.4
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets n/a
License MIT
Doc PR n/a

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

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
@greg0ire
Copy link
Contributor Author

@prisis @lyrixx please review

$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

@lyrixx
Copy link
Member

lyrixx commented Sep 17, 2018

Is is hard to add a test case for this ?

@greg0ire
Copy link
Contributor Author

The test already exists, what might be needed is a new Travis job with phpunit 7

@nicolas-grekas nicolas-grekas added this to the 3.4 milestone Sep 18, 2018
nicolas-grekas added a commit that referenced this pull request Sep 18, 2018
…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
@greg0ire greg0ire deleted the actually_run_the_coverage_listener branch September 18, 2018 11:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.