bug #36569 [PhpUnitBridge] Mark parent class also covered in CoverageListener (lyrixx)
This PR was merged into the 3.4 branch.
Discussion
----------
[PhpUnitBridge] Mark parent class also covered in CoverageListener
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| Deprecations? | no
| Tickets |
| License | MIT
| Doc PR |
Commits
-------
dcb5653728
[PhpUnitBridge] Mark parent class also covered in CoverageListener
This commit is contained in:
commit
9b8911598b
@ -73,10 +73,19 @@ class CoverageListenerTrait
|
||||
$r = new \ReflectionProperty($testClass, 'annotationCache');
|
||||
$r->setAccessible(true);
|
||||
|
||||
$covers = $sutFqcn;
|
||||
if (!\is_array($sutFqcn)) {
|
||||
$covers = [$sutFqcn];
|
||||
while ($parent = get_parent_class($sutFqcn)) {
|
||||
$covers[] = $parent;
|
||||
$sutFqcn = $parent;
|
||||
}
|
||||
}
|
||||
|
||||
$cache = $r->getValue();
|
||||
$cache = array_replace_recursive($cache, array(
|
||||
\get_class($test) => array(
|
||||
'covers' => \is_array($sutFqcn) ? $sutFqcn : array($sutFqcn),
|
||||
'covers' => $covers,
|
||||
),
|
||||
));
|
||||
$r->setValue($testClass, $cache);
|
||||
|
Reference in New Issue
Block a user