-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[PhpUnitBridge] CoverageListenerTrait update for PHPUnit 8.5/9.x #38054
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
Conversation
I think I addressed all comments. How should I test this change? I see there's a test, but it assumes a currently used version of PHPUnit. Should this be enough? |
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.
I see there's a test, but it assumes a currently used version of PHPUnit. Should this be enough?
Yes, we're not going to test with multiple versions of phpunit.
Thank you @sanmai. |
Thank you for working on this issue, @sanmai! 🚀 |
…rait for PHPUnit 9.3 (sanmai, derrabus) This PR was merged into the 3.4 branch. Discussion ---------- [PhpUnitBridge] Adjust output parsing of CoverageListenerTrait for PHPUnit 9.3 | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | #37637, #37564 | License | MIT | Doc PR | N/A This PR makes `CoverageListenerTrait` pass with PHPUnit 9.3. It contains a backport of #38054. The problem that is addressed here is that a one of the fixture classes is now included in the output despite having a coverage of zero. The test now accepts both cases: * The class is omitted from the output * The class appears with 0.00% coverage. Commits ------- a3831dc [PhpUnitBridge] Adjust output parsing for PHPUnit 9.3. 99c98bd [PhpUnitBridge] CoverageListenerTrait update for PHPUnit 8.5/9.x
…rait (sanmai) This PR was squashed before being merged into the 4.4 branch. Discussion ---------- [PhpUnitBridge] Skip internal classes in CoverageListenerTrait 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.](https://github.com/sebastianbergmann/code-unit/blob/60c6fb972b3262e423be3000e7b8c67cbc477580/tests/unit/ClassMethodUnitTest.php#L49-L54) | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Follow-up to #38054 | License | MIT Commits ------- a0dedb9 [PhpUnitBridge] Skip internal classes in CoverageListenerTrait
Updated to use
PHPUnit\Util\Annotation\Registry
and related classes.Fixes #37637
If this is a sensible approach, I will try to add a test for this addition.