@@ -458,11 +458,30 @@ public function providePathTests(): \Generator
458458 yield ['.. ' , '/webmozart/symfony ' , '/webmozart ' ];
459459 }
460460
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+
461482 public function provideMakeAbsoluteTests (): \Generator
462483 {
463- foreach ($ this ->providePathTests () as $ set ) {
464- yield $ set ;
465- }
484+ yield from static ::getPathTests ();
466485
467486 // collapse dots
468487 yield ['css/./style.css ' , '/webmozart/symfony ' , '/webmozart/symfony/css/style.css ' ];
@@ -589,7 +608,7 @@ public function testMakeAbsoluteDoesNotFailIfDifferentRoot(string $basePath, str
589608
590609 public function provideMakeRelativeTests (): \Generator
591610 {
592- foreach ($ this -> providePathTests () as $ set ) {
611+ foreach (static :: getPathTests () as $ set ) {
593612 yield [$ set [2 ], $ set [1 ], $ set [0 ]];
594613 }
595614
0 commit comments