public function setUp()
 {
     parent::setUp();
     $this->db('PHPCR')->createTestNode();
     $this->routeAdmin = $this->getContainer()->get('cmf_routing.route_admin');
     $this->errorElement = $this->getMockBuilder('Sonata\\AdminBundle\\Validator\\ErrorElement')->disableOriginalConstructor()->getMock();
 }
 public function setUp()
 {
     parent::setUp();
     $this->db('PHPCR')->createTestNode();
     $this->createRoute(self::ROUTE_ROOT);
     $this->repository = $this->getContainer()->get('cmf_routing.route_provider');
 }
 public function setUp()
 {
     parent::setUp();
     $this->db('PHPCR')->createTestNode();
     $this->createRoute(self::ROUTE_ROOT);
     $router = $this->getContainer()->get('router');
     $this->controller = new RedirectController($router);
 }
 public function setUp()
 {
     parent::setUp();
     $this->db('PHPCR')->createTestNode();
     $this->createRoute(self::ROUTE_ROOT);
     $this->router = $this->getContainer()->get('router');
     $root = $this->getDm()->find(null, self::ROUTE_ROOT);
     // do not set a content here, or we need a valid request and so on...
     $route = new Route();
     $route->setPosition($root, 'testroute');
     $route->setVariablePattern('/{slug}/{id}');
     $route->setDefault('id', '0');
     $route->setRequirement('id', '[0-9]+');
     $route->setDefault(RouteObjectInterface::CONTROLLER_NAME, 'testController');
     //TODO options
     $this->getDm()->persist($route);
     $childroute = new Route();
     $childroute->setPosition($route, 'child');
     $childroute->setDefault(RouteObjectInterface::CONTROLLER_NAME, 'testController');
     $this->getDm()->persist($childroute);
     $formatroute = new Route(array('add_format_pattern' => true));
     $formatroute->setPosition($root, 'format');
     $formatroute->setVariablePattern('/{id}');
     $formatroute->setRequirement('_format', 'html|json');
     $formatroute->setDefault(RouteObjectInterface::CONTROLLER_NAME, 'testController');
     $this->getDm()->persist($formatroute);
     $format2jsonroute = new Route(array('add_format_pattern' => true));
     $format2jsonroute->setPosition($root, 'format2.json');
     $format2jsonroute->setDefault('_format', 'json');
     $format2jsonroute->setRequirement('_format', 'json');
     $format2jsonroute->setDefault(RouteObjectInterface::CONTROLLER_NAME, 'testJsonController');
     $this->getDm()->persist($format2jsonroute);
     $format2route = new Route(array('add_format_pattern' => true));
     $format2route->setPosition($root, 'format2');
     $format2route->setDefault(RouteObjectInterface::CONTROLLER_NAME, 'testController');
     $this->getDm()->persist($format2route);
     $this->getDm()->flush();
 }
Beispiel #5
0
 public function setUp()
 {
     parent::setUp();
     $this->db('PHPCR')->createTestNode();
     $this->createRoute(self::ROUTE_ROOT);
 }