public function testCollection()
 {
     $routeCollection = new RouteCollection('base.Code.Route', 'baseRouteName', 'baseRoutePattern', 'baseControllerName');
     $routeCollection->add('view');
     $this->assertTrue($routeCollection->has('view'));
     $routeCollection->remove('view');
     $this->assertFalse($routeCollection->has('view'));
     $routeCollection->add('create');
     $route = $routeCollection->get('create');
     $this->assertInstanceOf('Symfony\\Component\\Routing\\Route', $route);
     $routeCollection->add('view');
     $routeCollection->add('edit');
     $routeCollection->clear();
     $this->assertFalse($routeCollection->has('create'));
     $this->assertFalse($routeCollection->has('view'));
     $this->assertFalse($routeCollection->has('edit'));
     $routeCollection->add('create');
     $routeCollection->add('view');
     $routeCollection->add('edit');
     $routeCollection->add('list');
     $routeCollection->clearExcept(array('create', 'edit'));
     $this->assertTrue($routeCollection->has('create'));
     $this->assertTrue($routeCollection->has('edit'));
     $this->assertFalse($routeCollection->has('view'));
     $this->assertFalse($routeCollection->has('list'));
 }
Пример #2
0
 /**
  * @param RouteCollection $collection
  */
 protected function configureRoutes(RouteCollection $collection)
 {
     $collection->clear();
 }
Пример #3
0
 protected function configureRoutes(RouteCollection $collection) 
 {
     $collection->clear();
     $collection->add('pageinfo');
 }