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());
 }
Ejemplo n.º 2
0
 /**
  * Add any extra required arguments to the command.
  *
  * @param CommandDefinition $commandDefinition
  */
 public function configureInput(CommandDefinition $commandDefinition)
 {
     $commandDefinition->addArgument(CommandArgument::required('program'));
 }