@@ -458,11 +458,30 @@ public function providePathTests(): \Generator
458
458
yield ['.. ' , '/webmozart/symfony ' , '/webmozart ' ];
459
459
}
460
460
461
+ private static function getPathTests (): \Generator
462
+ {
463
+ yield from [
464
+ // relative to absolute path
465
+ ['css/style.css ' , '/webmozart/symfony ' , '/webmozart/symfony/css/style.css ' ],
466
+ ['../css/style.css ' , '/webmozart/symfony ' , '/webmozart/css/style.css ' ],
467
+ ['../../css/style.css ' , '/webmozart/symfony ' , '/css/style.css ' ],
468
+
469
+ // relative to root
470
+ ['css/style.css ' , '/ ' , '/css/style.css ' ],
471
+ ['css/style.css ' , 'C: ' , 'C:/css/style.css ' ],
472
+ ['css/style.css ' , 'C:/ ' , 'C:/css/style.css ' ],
473
+
474
+ // same sub directories in different base directories
475
+ ['../../symfony/css/style.css ' , '/webmozart/css ' , '/symfony/css/style.css ' ],
476
+
477
+ ['' , '/webmozart/symfony ' , '/webmozart/symfony ' ],
478
+ ['.. ' , '/webmozart/symfony ' , '/webmozart ' ],
479
+ ];
480
+ }
481
+
461
482
public function provideMakeAbsoluteTests (): \Generator
462
483
{
463
- foreach ($ this ->providePathTests () as $ set ) {
464
- yield $ set ;
465
- }
484
+ yield from static ::getPathTests ();
466
485
467
486
// collapse dots
468
487
yield ['css/./style.css ' , '/webmozart/symfony ' , '/webmozart/symfony/css/style.css ' ];
@@ -589,7 +608,7 @@ public function testMakeAbsoluteDoesNotFailIfDifferentRoot(string $basePath, str
589
608
590
609
public function provideMakeRelativeTests (): \Generator
591
610
{
592
- foreach ($ this -> providePathTests () as $ set ) {
611
+ foreach (static :: getPathTests () as $ set ) {
593
612
yield [$ set [2 ], $ set [1 ], $ set [0 ]];
594
613
}
595
614
0 commit comments