@@ -569,6 +569,20 @@ public function testIteratorKeys(Adapter\AdapterInterface $adapter)
569
569
}
570
570
}
571
571
572
+ /**
573
+ * @dataProvider getAdaptersTestData
574
+ */
575
+ public function testRegexSpecialCharsLocationWithPathRestrictionContainingStartFlag (Adapter \AdapterInterface $ adapter )
576
+ {
577
+ $ finder = $ this ->buildFinder ($ adapter );
578
+ $ finder ->in (__DIR__ .DIRECTORY_SEPARATOR .'Fixtures ' .DIRECTORY_SEPARATOR .'r+e.g?e*x[c]a(r)s ' )
579
+ ->path ('/^dir/ ' );
580
+
581
+ $ expected = array ('r+e.g?e*x[c]a(r)s ' .DIRECTORY_SEPARATOR .'dir ' ,
582
+ 'r+e.g?e*x[c]a(r)s ' .DIRECTORY_SEPARATOR .'dir ' .DIRECTORY_SEPARATOR .'bar.dat ' ,);
583
+ $ this ->assertIterator ($ this ->toAbsoluteFixtures ($ expected ), $ finder );
584
+ }
585
+
572
586
public function testAdaptersOrdering ()
573
587
{
574
588
$ finder = Finder::create ()
@@ -673,23 +687,23 @@ public function getTestPathData()
673
687
$ tests = array (
674
688
array ('' , '' , array ()),
675
689
array ('/^A\/B\/C/ ' , '/C$/ ' ,
676
- array ('A ' .DIRECTORY_SEPARATOR .'B ' .DIRECTORY_SEPARATOR .'C ' .DIRECTORY_SEPARATOR .'abc.dat ' )
690
+ array ('A ' .DIRECTORY_SEPARATOR .'B ' .DIRECTORY_SEPARATOR .'C ' .DIRECTORY_SEPARATOR .'abc.dat ' ),
677
691
),
678
692
array ('/^A\/B/ ' , 'foobar ' ,
679
693
array (
680
694
'A ' .DIRECTORY_SEPARATOR .'B ' ,
681
695
'A ' .DIRECTORY_SEPARATOR .'B ' .DIRECTORY_SEPARATOR .'C ' ,
682
696
'A ' .DIRECTORY_SEPARATOR .'B ' .DIRECTORY_SEPARATOR .'ab.dat ' ,
683
697
'A ' .DIRECTORY_SEPARATOR .'B ' .DIRECTORY_SEPARATOR .'C ' .DIRECTORY_SEPARATOR .'abc.dat ' ,
684
- )
698
+ ),
685
699
),
686
700
array ('A/B/C ' , 'foobar ' ,
687
701
array (
688
702
'A ' .DIRECTORY_SEPARATOR .'B ' .DIRECTORY_SEPARATOR .'C ' ,
689
703
'A ' .DIRECTORY_SEPARATOR .'B ' .DIRECTORY_SEPARATOR .'C ' .DIRECTORY_SEPARATOR .'abc.dat ' ,
690
704
'copy ' .DIRECTORY_SEPARATOR .'A ' .DIRECTORY_SEPARATOR .'B ' .DIRECTORY_SEPARATOR .'C ' ,
691
705
'copy ' .DIRECTORY_SEPARATOR .'A ' .DIRECTORY_SEPARATOR .'B ' .DIRECTORY_SEPARATOR .'C ' .DIRECTORY_SEPARATOR .'abc.dat.copy ' ,
692
- )
706
+ ),
693
707
),
694
708
array ('A/B ' , 'foobar ' ,
695
709
array (
@@ -703,12 +717,12 @@ public function getTestPathData()
703
717
'A ' .DIRECTORY_SEPARATOR .'B ' .DIRECTORY_SEPARATOR .'C ' .DIRECTORY_SEPARATOR .'abc.dat ' ,
704
718
'copy ' .DIRECTORY_SEPARATOR .'A ' .DIRECTORY_SEPARATOR .'B ' .DIRECTORY_SEPARATOR .'ab.dat.copy ' ,
705
719
'copy ' .DIRECTORY_SEPARATOR .'A ' .DIRECTORY_SEPARATOR .'B ' .DIRECTORY_SEPARATOR .'C ' .DIRECTORY_SEPARATOR .'abc.dat.copy ' ,
706
- )
720
+ ),
707
721
),
708
722
array ('/^with space\// ' , 'foobar ' ,
709
723
array (
710
724
'with space ' .DIRECTORY_SEPARATOR .'foo.txt ' ,
711
- )
725
+ ),
712
726
),
713
727
);
714
728
@@ -808,7 +822,7 @@ private function getValidAdapters()
808
822
array (
809
823
new Adapter \BsdFindAdapter (),
810
824
new Adapter \GnuFindAdapter (),
811
- new Adapter \PhpAdapter ()
825
+ new Adapter \PhpAdapter (),
812
826
),
813
827
function (Adapter \AdapterInterface $ adapter ) {
814
828
return $ adapter ->isSupported ();
0 commit comments