$generator->
getContext()->
setHost(''
);
$generator->
getContext()->
setScheme(''
);
$this->
assertSame('/app.php/path',
$generator->
generate('test',
[], UrlGeneratorInterface::ABSOLUTE_URL
));
} public function testAbsoluteUrlWithNonHttpSchemeAndEmptyHost() { $routes =
$this->
getRoutes('test',
new Route('/path',
[],
[],
[], '',
['file'
]));
$generator =
$this->
getGenerator($routes);
$generator->
getContext()->
setBaseUrl(''
);
$generator->
getContext()->
setHost(''
);
$this->
assertSame('file:///path',
$generator->
generate('test',
[], UrlGeneratorInterface::ABSOLUTE_URL
));
} public function testGenerateNetworkPath() { $routes =
$this->
getRoutes('test',
new Route('/{name}',
[],
[],
[], '{locale}.example.com',
['http'
]));
$this->
assertSame('//fr.example.com/app.php/Fabien',
$this->
getGenerator($routes)->
generate('test',
['name' => 'Fabien', 'locale' => 'fr'
], UrlGeneratorInterface::NETWORK_PATH
), 'network path with different host'
);