Esempio n. 1
0
 public function testCanCreateRequiredArg()
 {
     $name = '<command>';
     $desc = 'The <command> you need help with';
     $obj = new DefinedArg($name, $desc);
     $obj->setIsRequired();
     // did it work?
     $this->assertEquals($name, $obj->name);
     $this->assertEquals($desc, $obj->desc);
     $this->assertTrue($obj->testIsRequired());
     $this->assertFalse($obj->testIsOptional());
 }
Esempio n. 2
0
 /**
  * Add an argument that this switch requires
  * 
  * @param string $argName the name of the argument
  * @param string $argDesc the argument's description
  * @return DefinedSwitch
  */
 public function setWithRequiredArg($argName, $argDesc)
 {
     $this->arg = new DefinedArg($argName, $argDesc);
     $this->arg->setIsRequired();
     return $this;
 }