예제 #1
0
 /**
  * @param IInput $input
  * @param IConsole $console
  *
  * @return ICommand
  * @throws AmbiguousCommandException
  * @throws CommandNotFoundException
  */
 protected function findCommand(IInput $input, IConsole $console)
 {
     if ($input->hasArgument('command')) {
         $matcher = new ArgumentsMatcher(new ArgumentsParser());
         return $matcher->findCommand($console->getCommands(), $input->getArgument('command'));
     }
     return $input->getCommand();
 }
예제 #2
0
 function it_uses_self_as_command(IInput $input)
 {
     $console = new Console();
     $input->hasArgument('command')->willReturn(false);
     $input->getCommand()->willReturn(new Command());
     $output = new Output();
     $output->setEnableBuffering(true);
     $this->run($input, $output, $console);
 }