Contao\CoreBundle\Test\Routing\FrontendLoaderTest::getRouter PHP Méthode

getRouter() private méthode

Generates a router using the given RouteCollection.
private getRouter ( RouteCollection $collection, string $urlSuffix = '.html' ) : Router
$collection Symfony\Component\Routing\RouteCollection
$urlSuffix string
Résultat Symfony\Bundle\FrameworkBundle\Routing\Router
    private function getRouter(RouteCollection $collection, $urlSuffix = '.html')
    {
        $loader = $this->getMock('Symfony\\Component\\Config\\Loader\\LoaderInterface');
        $loader->expects($this->any())->method('load')->willReturn($collection);
        /** @var ContainerInterface|\PHPUnit_Framework_MockObject_MockObject $container */
        $container = $this->getMock('Symfony\\Component\\DependencyInjection\\Container', ['get', 'getParameter']);
        $container->expects($this->any())->method('getParameter')->with('contao.url_suffix')->willReturn($urlSuffix);
        $container->expects($this->any())->method('get')->with('routing.loader')->willReturn($loader);
        return new Router($container, '');
    }