/** * Does this switch require an argument? * * @return boolean */ public function testHasRequiredArgument() { if (!$this->arg instanceof DefinedArg) { return false; } return $this->arg->testIsRequired(); }
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()); }