public function testSimple() { $desc = pakePHPDoc::getDescriptions('pakePHPDocTest_test1'); $this->assertEqual(2, count($desc)); $this->assertEqual('', $desc[0]); $this->assertEqual('', $desc[1]); $desc = pakePHPDoc::getDescriptions('pakePHPDocTest_test2'); $this->assertEqual(2, count($desc)); $this->assertEqual('short description', $desc[0]); $this->assertEqual('long description', $desc[1]); $desc = pakePHPDoc::getDescriptions('pakePHPDocTest_test3'); $this->assertEqual(2, count($desc)); $this->assertEqual('short description still short description', $desc[0]); $this->assertEqual('', $desc[1]); $desc = pakePHPDoc::getDescriptions('pakePHPDocTest_test4'); $this->assertEqual(2, count($desc)); $this->assertEqual('short description', $desc[0]); $this->assertEqual('', $desc[1]); $desc = pakePHPDoc::getDescriptions('pakePHPDocTest_test5'); $this->assertEqual(2, count($desc)); $this->assertEqual('short description. still short description', $desc[0]); $this->assertEqual('', $desc[1]); $desc = pakePHPDoc::getDescriptions('pakePHPDocTest_test6'); $this->assertEqual(2, count($desc)); $this->assertEqual('short description. still short description', $desc[0]); $this->assertEqual('', $desc[1]); $desc = pakePHPDoc::getDescriptions('pakePHPDocTest_test7'); $this->assertEqual(2, count($desc)); $this->assertEqual('short description.', $desc[0]); $this->assertEqual('long description', $desc[1]); }
public function set_help() { if (self::$last_help) { $help_to_add = self::$last_help; self::$last_help = ''; } else { $descriptions = pakePHPDoc::getDescriptions($this->getCallable()); $help_to_add = $descriptions[1]; } if (empty($help_to_add)) { return; } $this->help = $help_to_add; }