Skip to content

Commit

Permalink
bug #32902 [PhpUnitBridge] Allow sutFqcnResolver to return array (Vin…
Browse files Browse the repository at this point in the history
…centLanglet)

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
-------

1451c0b  Allow sutFqcnResolver to return array
  • Loading branch information
nicolas-grekas committed Aug 4, 2019
2 parents dd814bf + 1451c0b commit 926246b
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -76,7 +76,7 @@ public function startTest($test)
$cache = $r->getValue();
$cache = array_replace_recursive($cache, array(
\get_class($test) => array(
'covers' => array($sutFqcn),
'covers' => \is_array($sutFqcn) ? $sutFqcn : array($sutFqcn),
),
));
$r->setValue($testClass, $cache);
Expand Down

0 comments on commit 926246b

Please sign in to comment.