public function testExceptionIsThrownWithWrongParameterToAddArgument() { $this->expectException(InvalidArgumentException::class); $msg = 'Parameter: "argument" can only be one of: "string", "PhpSchool\\PhpWorkshop\\CommandArgument" '; $msg .= 'Received: "stdClass"'; $this->expectExceptionMessage($msg); $definition = new CommandDefinition('animal', [], 'strlen'); $definition->addArgument(new \stdClass()); }
/** * Add any extra required arguments to the command. * * @param CommandDefinition $commandDefinition */ public function configureInput(CommandDefinition $commandDefinition) { $commandDefinition->addArgument(CommandArgument::required('program')); }