File tree Expand file tree Collapse file tree 2 files changed +19
-2
lines changed Expand file tree Collapse file tree 2 files changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -40,7 +40,10 @@ public static function create(
4040 ): self {
4141 return new self (
4242 array_unique (
43- array_map ('strtolower ' , $ names ),
43+ array_map (
44+ static fn (string $ name ) => strtolower (ltrim ($ name , '\\' )),
45+ $ names ,
46+ ),
4447 ),
4548 array_unique ($ regexes ),
4649 false ,
@@ -61,7 +64,9 @@ public static function createForConstants(
6164 return new self (
6265 array_unique (
6366 array_map (
64- static fn (string $ name ) => self ::lowerCaseConstantName ($ name ),
67+ static fn (string $ name ) => self ::lowerCaseConstantName (
68+ ltrim ($ name , '\\' ),
69+ ),
6570 $ names ,
6671 ),
6772 ),
Original file line number Diff line number Diff line change @@ -118,6 +118,18 @@ private static function provideNames(): iterable
118118 true ,
119119 ];
120120
121+ yield 'FQ namespaced name registered; match ' => [
122+ ['\PHPUnit\TestCase ' ],
123+ 'PHPUnit\TestCase ' ,
124+ true ,
125+ ];
126+
127+ yield 'namespaced name registered; (FQ) match ' => [
128+ ['PHPUnit\TestCase ' ],
129+ '\PHPUnit\TestCase ' ,
130+ true ,
131+ ];
132+
121133 yield 'namespaced name registered; different case ' => [
122134 ['PHPUnit\TestCase ' ],
123135 'PHPUNIT\TESTCASE ' ,
You can’t perform that action at this time.
0 commit comments