@@ -433,16 +433,11 @@ public function testIgnoreVCSIgnored()
433
433
->ignoreVCSIgnored (true )
434
434
);
435
435
436
- copy (__DIR__ .'/Fixtures/gitignore/search_root/b.txt ' , __DIR__ .'/Fixtures/gitignore/search_root/a.txt ' );
437
- copy (__DIR__ .'/Fixtures/gitignore/search_root/b.txt ' , __DIR__ .'/Fixtures/gitignore/search_root/c.txt ' );
438
- copy (__DIR__ .'/Fixtures/gitignore/search_root/dir/a.txt ' , __DIR__ .'/Fixtures/gitignore/search_root/dir/b.txt ' );
439
- copy (__DIR__ .'/Fixtures/gitignore/search_root/dir/a.txt ' , __DIR__ .'/Fixtures/gitignore/search_root/dir/c.txt ' );
440
-
441
- $ this ->assertIterator ($ this ->toAbsoluteFixtures ([
436
+ $ this ->assertIterator (self ::toAbsolute ([
442
437
'gitignore/search_root/b.txt ' ,
443
438
'gitignore/search_root/dir ' ,
444
439
'gitignore/search_root/dir/a.txt ' ,
445
- ]), $ finder ->in (__DIR__ . ' /Fixtures/ gitignore/search_root ' )->getIterator ());
440
+ ]), $ finder ->in (self :: toAbsolute ( ' gitignore/search_root ') )->getIterator ());
446
441
}
447
442
448
443
public function testIgnoreVCSIgnoredUpToFirstGitRepositoryRoot ()
@@ -456,21 +451,39 @@ public function testIgnoreVCSIgnoredUpToFirstGitRepositoryRoot()
456
451
->ignoreVCSIgnored (true )
457
452
);
458
453
459
- copy (__DIR__ .'/Fixtures/gitignore/git_root/search_root/b.txt ' , __DIR__ .'/Fixtures/gitignore/git_root/search_root/a.txt ' );
460
- copy (__DIR__ .'/Fixtures/gitignore/git_root/search_root/b.txt ' , __DIR__ .'/Fixtures/gitignore/git_root/search_root/c.txt ' );
461
- copy (__DIR__ .'/Fixtures/gitignore/git_root/search_root/dir/a.txt ' , __DIR__ .'/Fixtures/gitignore/git_root/search_root/dir/b.txt ' );
462
- copy (__DIR__ .'/Fixtures/gitignore/git_root/search_root/dir/a.txt ' , __DIR__ .'/Fixtures/gitignore/git_root/search_root/dir/c.txt ' );
463
- if (!is_dir ($ gitDir = __DIR__ .'/Fixtures/gitignore/git_root/.git ' )) {
464
- mkdir ($ gitDir );
465
- }
466
-
467
- $ this ->assertIterator ($ this ->toAbsoluteFixtures ([
454
+ $ this ->assertIterator (self ::toAbsolute ([
468
455
'gitignore/git_root/search_root/b.txt ' ,
469
456
'gitignore/git_root/search_root/c.txt ' ,
470
457
'gitignore/git_root/search_root/dir ' ,
471
458
'gitignore/git_root/search_root/dir/a.txt ' ,
472
459
'gitignore/git_root/search_root/dir/c.txt ' ,
473
- ]), $ finder ->in (__DIR__ .'/Fixtures/gitignore/git_root/search_root ' )->getIterator ());
460
+ ]), $ finder ->in (self ::toAbsolute ('gitignore/git_root/search_root ' ))->getIterator ());
461
+ }
462
+
463
+ public function testIgnoreVCSIgnoredWithOpenBasedir ()
464
+ {
465
+ if (ini_get ('open_basedir ' )) {
466
+ $ this ->markTestSkipped ('Cannot test when open_basedir is set ' );
467
+ }
468
+
469
+ $ finder = $ this ->buildFinder ();
470
+ $ this ->assertSame (
471
+ $ finder ,
472
+ $ finder
473
+ ->ignoreVCS (true )
474
+ ->ignoreDotFiles (true )
475
+ ->ignoreVCSIgnored (true )
476
+ );
477
+
478
+ $ this ->iniSet ('open_basedir ' , '. ' .\PATH_SEPARATOR .self ::toAbsolute ('gitignore/search_root ' ));
479
+
480
+ $ this ->assertIterator (self ::toAbsolute ([
481
+ 'gitignore/search_root/b.txt ' ,
482
+ 'gitignore/search_root/c.txt ' ,
483
+ 'gitignore/search_root/dir ' ,
484
+ 'gitignore/search_root/dir/a.txt ' ,
485
+ 'gitignore/search_root/dir/c.txt ' ,
486
+ ]), $ finder ->in (self ::toAbsolute ('gitignore/search_root ' ))->getIterator ());
474
487
}
475
488
476
489
public function testIgnoreVCSCanBeDisabledAfterFirstIteration ()
@@ -1488,6 +1501,6 @@ public function testIgnoredAccessDeniedException()
1488
1501
1489
1502
protected function buildFinder ()
1490
1503
{
1491
- return Finder::create ();
1504
+ return Finder::create ()-> exclude ( ' gitignore ' ) ;
1492
1505
}
1493
1506
}
0 commit comments