Merge pull request #3 from rvanvelzen/master

Fix phpDocumentor/phpDocumentor2#467
This commit is contained in:
Mike van Riel
2012-06-04 13:34:54 -07:00
2 changed files with 22 additions and 4 deletions
+4 -4
View File
@@ -127,11 +127,11 @@ class DocBlock implements \Reflector
preg_match( preg_match(
'/(?x) '/(?x)
\A ( \A (
[^\n]+ [^\n.]+
(?: (?:
(?! (?<=\.) \n | \n{2} ) # disallow the first seperator here (?! \. \s | \n{2} ) # disallow the first seperator here
\n (?! [ \t]* @\pL ) # disallow second seperator [\n.] (?! [ \t]* @\pL ) # disallow second seperator
[^\n]+ [^\n.]+
)* )*
\.? \.?
) )
@@ -44,4 +44,22 @@ DOCBLOCK;
$this->assertTrue($object->hasTag('see')); $this->assertTrue($object->hasTag('see'));
$this->assertTrue($object->hasTag('return')); $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()
);
} }
}