Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Commitba61d89

Browse files
bug#38094 [PhpUnitBridge] Skip internal classes in CoverageListenerTrait (sanmai)
This PR was squashed before being merged into the 4.4 branch.Discussion----------[PhpUnitBridge] Skip internal classes in CoverageListenerTraitPHPUnit 9+ is picky about test covering, say, a `\RuntimeException`. Fails with the likes: "@Covers RuntimeException" is invalidJudging by the commitsebastianbergmann/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 | MITCommits-------a0dedb9 [PhpUnitBridge] Skip internal classes in CoverageListenerTrait
2 parentsf8fddf3 +a0dedb9 commitba61d89

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

‎src/Symfony/Bridge/PhpUnit/Legacy/CoverageListenerTrait.php‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,13 @@ private function addCoversForDocBlockInsideRegistry($test, $covers)
107107
$symbolAnnotations =new \ReflectionProperty($docBlock,'symbolAnnotations');
108108
$symbolAnnotations->setAccessible(true);
109109

110+
// Exclude internal classes; PHPUnit 9.1+ is picky about tests covering, say, a \RuntimeException
111+
$covers =array_filter($covers,function ($class) {
112+
$reflector =newReflectionClass($class);
113+
114+
return$reflector->isUserDefined();
115+
});
116+
110117
$symbolAnnotations->setValue($docBlock,array_replace($docBlock->symbolAnnotations(), [
111118
'covers' =>$covers,
112119
]));

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp