Skip to content

Commit e42dd58

Browse files
Fix handling of --covers / --uses CLI options with function targets
1 parent 4872720 commit e42dd58

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Metadata/Api/Groups.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
use function array_key_exists;
1414
use function array_unique;
1515
use function assert;
16+
use function ltrim;
1617
use function strtolower;
1718
use function trim;
1819
use PHPUnit\Framework\TestSize\TestSize;
@@ -69,7 +70,7 @@ public function groups(string $className, string $methodName, bool $includeVirtu
6970
/** @phpstan-ignore booleanOr.alwaysTrue */
7071
assert($metadata instanceof CoversClass || $metadata instanceof CoversFunction);
7172

72-
$groups[] = '__phpunit_covers_' . $this->canonicalizeName($metadata->asStringForCodeUnitMapper());
73+
$groups[] = '__phpunit_covers_' . $this->canonicalizeName(ltrim($metadata->asStringForCodeUnitMapper(), ':'));
7374

7475
continue;
7576
}
@@ -86,7 +87,7 @@ public function groups(string $className, string $methodName, bool $includeVirtu
8687
/** @phpstan-ignore booleanOr.alwaysTrue */
8788
assert($metadata instanceof UsesClass || $metadata instanceof UsesFunction);
8889

89-
$groups[] = '__phpunit_uses_' . $this->canonicalizeName($metadata->asStringForCodeUnitMapper());
90+
$groups[] = '__phpunit_uses_' . $this->canonicalizeName(ltrim($metadata->asStringForCodeUnitMapper(), ':'));
9091

9192
continue;
9293
}

0 commit comments

Comments
 (0)