public function testHasArgument() { $input = new ArgvInput(['foo', 'bar', 'baz']); $this->assertTrue($input->hasArgument(0)); $this->assertTrue($input->hasArgument(1)); $this->assertFalse($input->hasArgument(2)); }
/** * @param InputInterface $input * @param OutputInterface $output */ public function run(InputInterface $input = null, OutputInterface $output = null) { if (!$input) { $input = new ArgvInput(); } if (!$output) { $output = new ConsoleOutput(); } if (!$input->hasArgument(0)) { $this->printJobsList($output); } else { $this->runJob($input->getArgument(0), $input, $output); } }