public static function setupBeforeClass(array $options = array(), $routebase = null)
 {
     parent::setupBeforeClass(array(), basename(self::ROUTE_ROOT));
     self::$router = self::$kernel->getContainer()->get('router');
     //        self::$routeNamePrefix = self::$kernel->getContainer()->get('symfony_cmf_routing_extra.route_repository')->getRouteNamePrefix();
     //        $root = self::$dm->find(null, self::ROUTE_ROOT);
     // do not set a content here, or we need a valid request and so on...
     $route = new Route();
     $route->setName('test_route');
     $route->setPath('/test/route');
     $route->setController('test_controller');
     self::$em->persist($route);
     self::$em->flush();
     self::$em->clear();
     //        $route->setPosition($root, 'testroute');
     //        $route->setVariablePattern('/{slug}/{id}');
     //        $route->setDefault('id', '0');
     //        $route->setRequirement('id', '[0-9]+');
     //        $route->setDefault(RouteObjectInterface::CONTROLLER_NAME, 'testController');
     // TODO: what are the options used for? we should test them too if it makes sense
     //        self::$dm->persist($route);
     //        $childroute = new Route;
     //        $childroute->setPosition($route, 'child');
     //        $childroute->setDefault(RouteObjectInterface::CONTROLLER_NAME, 'testController');
     //        self::$dm->persist($childroute);
     //        self::$dm->flush();
 }
 public static function setupBeforeClass(array $options = array())
 {
     parent::setupBeforeClass(array(), basename(self::ROUTE_ROOT));
     self::$controller = new GenericController();
     self::$controller->setContainer(self::$kernel->getContainer());
     self::$resolver = new ContentResolver();
     self::$resolver->setEntityManager(self::$em);
 }
 public static function setupBeforeClass(array $options = array(), $routebase = null)
 {
     parent::setupBeforeClass(array(), basename(self::ROUTE_ROOT));
     self::$repository = self::$em->getRepository('Raindrop\\RoutingBundle\\Entity\\Route');
 }
Exemplo n.º 4
0
 public static function setupBeforeClass(array $options = array(), $routebase = null)
 {
     parent::setupBeforeClass(array(), basename(self::ROUTE_ROOT));
     self::$resolver = new ContentResolver();
     self::$resolver->setEntityManager(self::$em);
 }