예제 #1
0
 /**
  *
  */
 public function testGetArguments()
 {
     $reader = $this->getReader();
     $arguments = ['foo', 'bar', 'baz', '--named=baz'];
     $input = new Input($reader, $arguments);
     $this->assertSame(['arg0' => 'foo', 'arg1' => 'bar', 'arg2' => 'baz', 'named' => 'baz'], $input->getArguments());
 }
예제 #2
0
 /**
  * Dispatches a command.
  *
  * @access  protected
  * @param   string     $command  Command
  */
 protected function dispatch($command)
 {
     if (!isset($this->commands[$command])) {
         $this->output->writeLn('<red>Unknown command [ ' . $command . ' ].</red>');
         $this->output->write(PHP_EOL);
         $this->listCommands();
         return;
     }
     $this->dispatcher->dispatch($this->commands[$command], $this->input->getArguments());
 }