@@ -69,9 +69,8 @@ public static function provideWildcard(): Generator
69
69
'/path/foo/baz ' => true ,
70
70
'/path/baz.php ' => true ,
71
71
'/path/foo/baz/boo.php ' => true ,
72
- '/path/example/file.php ' => false ,
72
+ '/path/example/file.php ' => true ,
73
73
'/ ' => false ,
74
- '' => false ,
75
74
],
76
75
];
77
76
@@ -81,9 +80,8 @@ public static function provideWildcard(): Generator
81
80
'/path/foo/bar ' => true ,
82
81
'/path/foo/baz ' => true ,
83
82
'/path/foo/baz/boo.php ' => true ,
84
- '/path/example/file.php ' => false ,
83
+ '/path/example/file.php ' => true ,
85
84
'/ ' => false ,
86
- '' => false ,
87
85
],
88
86
];
89
87
yield 'segment directory wildcard ' => [
@@ -138,7 +136,7 @@ public static function provideGlobstar(): Generator
138
136
[
139
137
'/foo ' => true ,
140
138
'/foo/bar ' => true ,
141
- '/ ' => false ,
139
+ '/ ' => true , // matches zero or more
142
140
],
143
141
];
144
142
@@ -177,7 +175,11 @@ public static function provideGlobstar(): Generator
177
175
],
178
176
];
179
177
180
- yield 'segment globstar with wildcard ' => [
178
+ // PHPUnit will match ALL directories within `/foo` with `/foo/A**`
179
+ // however it will NOT match anything with `/foo/Aa**`
180
+ //
181
+ // This is likely a bug and so we could consider "fixing" it
182
+ yield 'EDGE: segment globstar with wildcard ' => [
181
183
new FileMatcherPattern ('/foo/emm/**/*ar ' ),
182
184
[
183
185
'/foo/emm/bar ' => true ,
@@ -512,7 +514,7 @@ public static function provideCharacterGroup(): Generator
512
514
*/
513
515
public static function provideRelativePathSegments (): Generator
514
516
{
515
- yield 'equivalence class expressions ' => [
517
+ yield 'dot dot ' => [
516
518
new FileMatcherPattern ('/a/../a/c ' ),
517
519
[
518
520
'/a/a/c ' => true ,
@@ -529,10 +531,15 @@ private static function assertMap(FileMatcherPattern $pattern, array $matchMap):
529
531
foreach ($ matchMap as $ candidate => $ shouldMatch ) {
530
532
$ matches = FileMatcher::match ($ candidate , $ pattern );
531
533
if ($ matches === $ shouldMatch ) {
532
- $ this -> addToAssertionCount ( 1 );
534
+ self :: assertTrue ( true );
533
535
continue ;
534
536
}
535
- self ::fail (sprintf ('Expected the pattern "%s" to match path "%s" ' , $ pattern ->path , $ candidate ));
537
+ self ::fail (sprintf (
538
+ 'Expected the pattern "%s" %s match path "%s" ' ,
539
+ $ pattern ->path ,
540
+ $ shouldMatch ? 'to ' : 'to not ' ,
541
+ $ candidate
542
+ ));
536
543
}
537
544
}
538
545
}
0 commit comments