Contao\CoreBundle\Test\Routing\UrlGeneratorTest::testIndex PHP Метод

testIndex() публичный Метод

Tests that the index fragment is omitted.
public testIndex ( )
    public function testIndex()
    {
        $this->assertEquals('contao_index', $this->getGenerator(false, 0)->generate('index'));
        $this->assertEquals('contao_index', $this->getGenerator(true, 0)->generate('index'));
        $this->assertArrayNotHasKey('alias', $this->getGenerator()->generate('index'));
        $this->assertEquals('contao_frontend', $this->getGenerator(false, 0)->generate('index/foobar'));
        $this->assertArrayHasKey('alias', $this->getGenerator()->generate('index/foobar'));
        $this->assertEquals('contao_frontend', $this->getGenerator(false, 0)->generate('index/{foo}', ['foo' => 'bar']));
        $this->assertArrayHasKey('alias', $this->getGenerator()->generate('index/{foo}', ['foo' => 'bar']));
        $this->assertEquals('index/foo/bar', $this->getGenerator()->generate('index/{foo}', ['foo' => 'bar'])['alias']);
    }