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()); }
/** * 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; }