Exemplo n.º 1
0
 /**
  * Create a helper for executing command-tests in our application.
  *
  * @param array $args must include key "command"
  * @return \Symfony\Component\Console\Tester\CommandTester
  */
 public function createCommandTester($args)
 {
     if (!isset($args['command'])) {
         throw new \RuntimeException("Missing mandatory argument: command");
     }
     $application = new Application();
     $command = $application->find($args['command']);
     $commandTester = new CommandTester($command);
     $commandTester->execute($args);
     return $commandTester;
 }