/**
  * @return CommandTester
  */
 private function createCommandTester()
 {
     $application = new Application();
     $command = new RouterDebugCommand();
     $command->setContainer($this->getContainer());
     $application->add($command);
     return new CommandTester($application->find('router:debug'));
 }
Ejemplo n.º 2
0
 /**
  * @Route("/links")
  * @Template()
  * @Method("GET")
  */
 public function indexAction(Request $request)
 {
     $command = new RouterDebugCommand();
     $command->setContainer($this->container);
     $input = new StringInput('');
     $output = new BufferedOutput();
     $resultCode = $command->run($input, $output);
     // Removing the first line og the output
     $route_list = preg_replace('/^.+\\n/', '', $output->fetch());
     return array('route_list' => $route_list, 'allowed_hosts' => explode('|', $this->container->getParameter('zee_route_list.allowed_hosts')));
 }