use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
use Symfony\Component\Routing\RequestContext;
use Symfony\Component\Routing\Route;
use Symfony\Component\Routing\RouteCollection;
class UrlGeneratorTest extends TestCase
{ use ExpectDeprecationTrait;
public function testAbsoluteUrlWithPort80() { $routes =
$this->
getRoutes('test',
new Route('/testing'
));
$url =
$this->
getGenerator($routes)->
generate('test',
[], UrlGeneratorInterface::ABSOLUTE_URL
);
$this->
assertEquals('http://localhost/app.php/testing',
$url);
} public function testAbsoluteSecureUrlWithPort443() { $routes =
$this->
getRoutes('test',
new Route('/testing'
));
$url =
$this->
getGenerator($routes,
['scheme' => 'https'
])->
generate('test',
[], UrlGeneratorInterface::ABSOLUTE_URL
);
$this->
assertEquals('https://localhost/app.php/testing',
$url);
}