Skip to content

[PhpUnitBridge] Skip internal classes in CoverageListenerTrait #38094

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 0 commits into from
Sep 8, 2020
Merged

[PhpUnitBridge] Skip internal classes in CoverageListenerTrait #38094

merged 0 commits into from
Sep 8, 2020

Conversation

sanmai
Copy link
Contributor

@sanmai sanmai commented Sep 7, 2020

PHPUnit 9+ is picky about test covering, say, a \RuntimeException. Fails with the likes:

"@covers RuntimeException" is invalid

Judging by the commit sebastianbergmann/phpunit@e06850c this change is required for PHPUnit 9.1 and up. Here's it being tested.

Q A
Branch? 4.4
Bug fix? yes
New feature? no
Deprecations? no
Tickets Follow-up to #38054
License MIT

@sanmai
Copy link
Contributor Author

sanmai commented Sep 7, 2020

@derrabus if you have a second to have a look

@derrabus
Copy link
Member

derrabus commented Sep 7, 2020

Can you provide an example of a test that would fail without your changes?

@sanmai
Copy link
Contributor Author

sanmai commented Sep 7, 2020

Sure, this is how it looks.

This FileNotFound extends RuntimeException, so both will be inside $covers array.

@chalasr chalasr added this to the 4.4 milestone Sep 7, 2020
@sanmai
Copy link
Contributor Author

sanmai commented Sep 7, 2020

@nicolas-grekas nicolas-grekas changed the title [PhpUnitBridge] Exclude non-namespaced classes [PhpUnitBridge] Exclude internal classes Sep 8, 2020
@nicolas-grekas nicolas-grekas changed the title [PhpUnitBridge] Exclude internal classes [PhpUnitBridge] Skip internal classes in CoverageListenerTrait Sep 8, 2020
@nicolas-grekas
Copy link
Member

Thank you @sanmai.

@nicolas-grekas nicolas-grekas merged commit ba61d89 into symfony:4.4 Sep 8, 2020
@sanmai sanmai deleted the patch-1 branch September 8, 2020 07:26
nicolas-grekas added a commit that referenced this pull request Sep 15, 2020
This PR was merged into the 4.4 branch.

Discussion
----------

[PhpUnitBridge] Fix error with ReflectionClass

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| License       | MIT

Introduced in #38094. Wish I know how I missed that.

Commits
-------

ed1bffe [PhpUnitBridge] Fix error with ReflectionClass
This was referenced Sep 27, 2020
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.

5 participants