Fixed the case where the dot does not properly terminate the short description.

The regular expression only took into account newlines, not general whitespace after the dot. Added a test case as well.
This commit is contained in:
Richard van Velzen
2012-06-04 09:27:56 +02:00
parent f0a2901e56
commit a5b50ba482
2 changed files with 22 additions and 4 deletions
@@ -44,4 +44,22 @@ DOCBLOCK;
$this->assertTrue($object->hasTag('see'));
$this->assertTrue($object->hasTag('return'));
}
public function testDotSeperation()
{
$fixture = <<<DOCBLOCK
/**
* This is a short description. This is a long description.
* This is a continuation of the long description.
*/
DOCBLOCK;
$object = new DocBlock($fixture);
$this->assertEquals(
'This is a short description.', $object->getShortDescription()
);
$this->assertEquals(
"This is a long description.\nThis is a continuation of the long description.", $object->getLongDescription()->getContents()
);
}
}