Skip to content

Commit 85a4dd4

Browse files
bug #32902 [PhpUnitBridge] Allow sutFqcnResolver to return array (VincentLanglet)
This PR was merged into the 3.4 branch. Discussion ---------- [PhpUnitBridge] Allow sutFqcnResolver to return array | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #... | License | MIT | Doc PR | Phpunit handle multiple covers annotation: ``` /** * @Covers ClassOne * @Covers ClassTwo */ ``` The coverage solver was only allowed to return `ClassOne` or `ClassTwo` since it was transformed to `[ClassName]`. Returning `[ClassOne, ClassTwo]` was transform to [[ClassOne, ClassTwo]]` which was creating an error with phpunit. This PR fixed this case. Commits ------- 1451c0b915 Allow sutFqcnResolver to return array
2 parents 43f1d05 + eee8baa commit 85a4dd4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Legacy/CoverageListenerTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public function startTest($test)
7676
$cache = $r->getValue();
7777
$cache = array_replace_recursive($cache, array(
7878
\get_class($test) => array(
79-
'covers' => array($sutFqcn),
79+
'covers' => \is_array($sutFqcn) ? $sutFqcn : array($sutFqcn),
8080
),
8181
));
8282
$r->setValue($testClass, $cache);

0 commit comments

Comments
 (0)