Ejemplo n.º 1
0
 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');
 }
Ejemplo n.º 2
0
 /**
  * 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.');
     }
 }