Contao\CoreBundle\Test\Routing\UrlGeneratorTest::testSetContextFromDomain PHP Method

testSetContextFromDomain() public method

Tests setting the context from a domain.
    public function testSetContextFromDomain()
    {
        $routes = new RouteCollection();
        $routes->add('contao_index', new Route('/'));
        $generator = new UrlGenerator(new ParentUrlGenerator($routes, new RequestContext()), $this->mockContaoFramework(), false);
        $this->assertEquals('https://contao.org/', $generator->generate('index', ['_domain' => 'contao.org:443', '_ssl' => true], UrlGeneratorInterface::ABSOLUTE_URL));
        $this->assertEquals('http://contao.org/', $generator->generate('index', ['_domain' => 'contao.org'], UrlGeneratorInterface::ABSOLUTE_URL));
        $this->assertEquals('http://contao.org/', $generator->generate('index', ['_domain' => 'contao.org:80'], UrlGeneratorInterface::ABSOLUTE_URL));
    }