/** * Tests that the context is not modified if the hostname is set. * * To tests this case, we omit the _ssl parameter and set the scheme to "https" in the context. If the * generator still returns a HTTPS URL, we know that the context has not been modified. */ public function testContextNotModifiedIfHostnameIsSet() { $routes = new RouteCollection(); $routes->add('contao_index', new Route('/')); $context = new RequestContext(); $context->setHost('contao.org'); $context->setScheme('https'); $generator = new UrlGenerator(new ParentUrlGenerator($routes, $context), $this->mockContaoFramework(), false); $this->assertEquals('https://contao.org/', $generator->generate('index', ['_domain' => 'contao.org'], UrlGeneratorInterface::ABSOLUTE_URL)); }