Exemplo n.º 1
0
 public function testInheritedRouteMatchParamsWorkWithModuleRouteListener()
 {
     $page = new Page\Mvc(array('label' => 'mpinkstonwashere', 'route' => 'lmaoplane'));
     $route = new SegmentRoute('/lmaoplane[/:controller]');
     $router = new TreeRouteStack();
     $router->addRoute('lmaoplane', $route);
     $routeMatch = new RouteMatch(array(ModuleRouteListener::MODULE_NAMESPACE => 'Application\\Controller', 'controller' => 'index'));
     $routeMatch->setMatchedRouteName('lmaoplane');
     $event = new MvcEvent();
     $event->setRouter($router)->setRouteMatch($routeMatch);
     $moduleRouteListener = new ModuleRouteListener();
     $moduleRouteListener->onRoute($event);
     $page->setRouter($event->getRouter());
     $page->setRouteMatch($event->getRouteMatch());
     $this->assertEquals('/lmaoplane', $page->getHref());
     $page->setUseRouteMatch(true);
     $this->assertEquals('/lmaoplane/index', $page->getHref());
 }