public function testExceptionIsThrowWhenTryingToAddRequiredArgAfterOptionalArg() { $this->expectException(InvalidArgumentException::class); $this->expectExceptionMessage('A required argument cannot follow an optional argument'); $definition = new CommandDefinition('animal', [], 'strlen'); $definition->addArgument(CommandArgument::optional('optional-arg'))->addArgument(CommandArgument::required('required-arg')); }
/** * Add any extra required arguments to the command. * * @param CommandDefinition $commandDefinition */ public function configureInput(CommandDefinition $commandDefinition) { $commandDefinition->addArgument(CommandArgument::required('program')); }