object = new CLI(); } /** * Tears down the fixture, for example, closes a network connection. * This method is called after a test is executed. */ protected function tearDown() { } /** * This is the default method to test, if the class still having * the same number of methods. */ public function testNumberOfMethodsInThisClass() { $methods = get_class_methods('CLI'); $this->assertTrue( count($methods) == 13); } /** * @covers CLI::taskName * @todo Implement testtaskName(). */ public function testtaskName() { $methods = get_class_methods($this->object); $this->assertTrue( in_array('taskName', $methods ), 'exists method taskName' ); $r = new ReflectionMethod('CLI', 'taskName'); $params = $r->getParameters(); $this->assertTrue( $params[0]->getName() == 'name'); $this->assertTrue( $params[0]->isArray() == false); $this->assertTrue( $params[0]->isOptional () == false); } /** * @covers CLI::taskDescription * @todo Implement testtaskDescription(). */ public function testtaskDescription() { $methods = get_class_methods($this->object); $this->assertTrue( in_array('taskDescription', $methods ), 'exists method taskDescription' ); $r = new ReflectionMethod('CLI', 'taskDescription'); $params = $r->getParameters(); $this->assertTrue( $params[0]->getName() == 'description'); $this->assertTrue( $params[0]->isArray() == false); $this->assertTrue( $params[0]->isOptional () == false); } /** * @covers CLI::taskArg * @todo Implement testtaskArg(). */ public function testtaskArg() { $methods = get_class_methods($this->object); $this->assertTrue( in_array('taskArg', $methods ), 'exists method taskArg' ); $r = new ReflectionMethod('CLI', 'taskArg'); $params = $r->getParameters(); $this->assertTrue( $params[0]->getName() == 'name'); $this->assertTrue( $params[0]->isArray() == false); $this->assertTrue( $params[0]->isOptional () == false); $this->assertTrue( $params[1]->getName() == 'optional'); $this->assertTrue( $params[1]->isArray() == false); $this->assertTrue( $params[1]->isOptional () == true); $this->assertTrue( $params[1]->getDefaultValue() == '1'); $this->assertTrue( $params[2]->getName() == 'multiple'); $this->assertTrue( $params[2]->isArray() == false); $this->assertTrue( $params[2]->isOptional () == true); $this->assertTrue( $params[2]->getDefaultValue() == ''); } /** * @covers CLI::taskOpt * @todo Implement testtaskOpt(). */ public function testtaskOpt() { $methods = get_class_methods($this->object); $this->assertTrue( in_array('taskOpt', $methods ), 'exists method taskOpt' ); $r = new ReflectionMethod('CLI', 'taskOpt'); $params = $r->getParameters(); $this->assertTrue( $params[0]->getName() == 'name'); $this->assertTrue( $params[0]->isArray() == false); $this->assertTrue( $params[0]->isOptional () == false); $this->assertTrue( $params[1]->getName() == 'description'); $this->assertTrue( $params[1]->isArray() == false); $this->assertTrue( $params[1]->isOptional () == false); $this->assertTrue( $params[2]->getName() == 'short'); $this->assertTrue( $params[2]->isArray() == false); $this->assertTrue( $params[2]->isOptional () == false); $this->assertTrue( $params[3]->getName() == 'long'); $this->assertTrue( $params[3]->isArray() == false); $this->assertTrue( $params[3]->isOptional () == true); $this->assertTrue( $params[3]->getDefaultValue() == ''); } /** * @covers CLI::taskRun * @todo Implement testtaskRun(). */ public function testtaskRun() { $methods = get_class_methods($this->object); $this->assertTrue( in_array('taskRun', $methods ), 'exists method taskRun' ); $r = new ReflectionMethod('CLI', 'taskRun'); $params = $r->getParameters(); $this->assertTrue( $params[0]->getName() == 'function'); $this->assertTrue( $params[0]->isArray() == false); $this->assertTrue( $params[0]->isOptional () == false); } /** * @covers CLI::help * @todo Implement testhelp(). */ public function testhelp() { $methods = get_class_methods($this->object); $this->assertTrue( in_array('help', $methods ), 'exists method help' ); $r = new ReflectionMethod('CLI', 'help'); $params = $r->getParameters(); $this->assertTrue( $params[0]->getName() == 'args'); $this->assertTrue( $params[0]->isArray() == false); $this->assertTrue( $params[0]->isOptional () == false); $this->assertTrue( $params[1]->getName() == 'opts'); $this->assertTrue( $params[1]->isArray() == false); $this->assertTrue( $params[1]->isOptional () == true); $this->assertTrue( $params[1]->getDefaultValue() == ''); } /** * @covers CLI::run * @todo Implement testrun(). */ public function testrun() { $methods = get_class_methods($this->object); $this->assertTrue( in_array('run', $methods ), 'exists method run' ); $r = new ReflectionMethod('CLI', 'run'); $params = $r->getParameters(); } /** * @covers CLI::info * @todo Implement testinfo(). */ public function testinfo() { $methods = get_class_methods($this->object); $this->assertTrue( in_array('info', $methods ), 'exists method info' ); $r = new ReflectionMethod('CLI', 'info'); $params = $r->getParameters(); $this->assertTrue( $params[0]->getName() == 'message'); $this->assertTrue( $params[0]->isArray() == false); $this->assertTrue( $params[0]->isOptional () == false); } /** * @covers CLI::warning * @todo Implement testwarning(). */ public function testwarning() { $methods = get_class_methods($this->object); $this->assertTrue( in_array('warning', $methods ), 'exists method warning' ); $r = new ReflectionMethod('CLI', 'warning'); $params = $r->getParameters(); $this->assertTrue( $params[0]->getName() == 'message'); $this->assertTrue( $params[0]->isArray() == false); $this->assertTrue( $params[0]->isOptional () == false); } /** * @covers CLI::error * @todo Implement testerror(). */ public function testerror() { $methods = get_class_methods($this->object); $this->assertTrue( in_array('error', $methods ), 'exists method error' ); $r = new ReflectionMethod('CLI', 'error'); $params = $r->getParameters(); $this->assertTrue( $params[0]->getName() == 'message'); $this->assertTrue( $params[0]->isArray() == false); $this->assertTrue( $params[0]->isOptional () == false); } /** * @covers CLI::prompt * @todo Implement testprompt(). */ public function testprompt() { $methods = get_class_methods($this->object); $this->assertTrue( in_array('prompt', $methods ), 'exists method prompt' ); $r = new ReflectionMethod('CLI', 'prompt'); $params = $r->getParameters(); $this->assertTrue( $params[0]->getName() == 'message'); $this->assertTrue( $params[0]->isArray() == false); $this->assertTrue( $params[0]->isOptional () == false); } /** * @covers CLI::question * @todo Implement testquestion(). */ public function testquestion() { $methods = get_class_methods($this->object); $this->assertTrue( in_array('question', $methods ), 'exists method question' ); $r = new ReflectionMethod('CLI', 'question'); $params = $r->getParameters(); $this->assertTrue( $params[0]->getName() == 'message'); $this->assertTrue( $params[0]->isArray() == false); $this->assertTrue( $params[0]->isOptional () == false); } /** * @covers CLI::logging * @todo Implement testlogging(). */ public function testlogging() { $methods = get_class_methods($this->object); $this->assertTrue( in_array('logging', $methods ), 'exists method logging' ); $r = new ReflectionMethod('CLI', 'logging'); $params = $r->getParameters(); $this->assertTrue( $params[0]->getName() == 'message'); $this->assertTrue( $params[0]->isArray() == false); $this->assertTrue( $params[0]->isOptional () == false); $this->assertTrue( $params[1]->getName() == 'filename'); $this->assertTrue( $params[1]->isArray() == false); $this->assertTrue( $params[1]->isOptional () == true); $this->assertTrue( $params[1]->getDefaultValue() == ''); } }