/** * @dataProvider routingProvider */ public function testRoutingInstantiation($isProduction, $expectedObjectClass) { $this->configurationHandler->expects($this->exactly(2))->method('isProduction')->will($this->returnValue($isProduction)); RoutingTester::clear(); $router = RoutingTester::create($this->configurationHandler); $this->assertInstanceOf($expectedObjectClass, $router); $this->assertInstanceOf($expectedObjectClass, Routing::getRouting()); }
private function addWebsiteRoutes() { // FIXME This information comes from security and it is not available at this level $user = null; if (!$this->app["red_kite_cms.configuration_handler"]->isTheme()) { $user = '******'; } $routingGenerator = new RoutingGenerator($this->app["red_kite_cms.configuration_handler"]); Routing::create($this->app["red_kite_cms.configuration_handler"])->generateWebsiteRoutes($routingGenerator, $user); $this->app["red_kite_cms.website_routes"] = $routingGenerator->getRoutes(); $matcher = new ChainMatcher(array($this->app['url_matcher'], $this->app['router']->getMatcher())); $matcher->setContext($this->app['request_context']); $this->app['url_matcher'] = $matcher; }