public function testGetArgumentRequiredCount() { $this->initializeArguments(); $definition = new InputDefinition(); $definition->addArgument($this->foo2); $this->assertEquals(1, $definition->getArgumentRequiredCount(), '->getArgumentRequiredCount() returns the number of required arguments'); $definition->addArgument($this->foo); $this->assertEquals(1, $definition->getArgumentRequiredCount(), '->getArgumentRequiredCount() returns the number of required arguments'); }
/** * Validates the input. * * @throws RuntimeException When not enough arguments are given */ public function validate() { if (count($this->arguments) < $this->definition->getArgumentRequiredCount()) { throw new RuntimeException('Not enough arguments.'); } }