mirror of
https://github.com/barryvdh/ReflectionDocBlock.git
synced 2026-08-18 18:13:13 +00:00
Merge pull request #89 from Seldaek/fix_regex
Fix regex for tag name extraction and restore disabled test
This commit is contained in:
@@ -161,7 +161,7 @@ final class StandardTagFactory implements TagFactory
|
|||||||
private function extractTagParts($tagLine)
|
private function extractTagParts($tagLine)
|
||||||
{
|
{
|
||||||
$matches = array();
|
$matches = array();
|
||||||
if (! preg_match('/^@(' . self::REGEX_TAGNAME . ')(?:\s*([^\s].*)|$)?/us', $tagLine, $matches)) {
|
if (! preg_match('/^@(' . self::REGEX_TAGNAME . ')(?:\s+([^\s].*)|$)/us', $tagLine, $matches)) {
|
||||||
throw new \InvalidArgumentException(
|
throw new \InvalidArgumentException(
|
||||||
'The tag "' . $tagLine . '" does not seem to be wellformed, please check it for errors'
|
'The tag "' . $tagLine . '" does not seem to be wellformed, please check it for errors'
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -136,14 +136,10 @@ class StandardTagFactoryTest extends \PHPUnit_Framework_TestCase
|
|||||||
* @uses phpDocumentor\Reflection\DocBlock\StandardTagFactory::__construct
|
* @uses phpDocumentor\Reflection\DocBlock\StandardTagFactory::__construct
|
||||||
* @uses phpDocumentor\Reflection\DocBlock\StandardTagFactory::addService
|
* @uses phpDocumentor\Reflection\DocBlock\StandardTagFactory::addService
|
||||||
* @expectedException \InvalidArgumentException
|
* @expectedException \InvalidArgumentException
|
||||||
* @expectedExceptionMessage The tag "@user/myuser" does not seem to be wellformed, please check it for errors
|
* @expectedExceptionMessage The tag "@user[myuser" does not seem to be wellformed, please check it for errors
|
||||||
*/
|
*/
|
||||||
public function testExceptionIsThrownIfProvidedTagIsNotWellformed()
|
public function testExceptionIsThrownIfProvidedTagIsNotWellformed()
|
||||||
{
|
{
|
||||||
$this->markTestIncomplete(
|
|
||||||
'For some reason this test fails; once I have access to a RegEx analyzer I will have to test the regex'
|
|
||||||
)
|
|
||||||
;
|
|
||||||
$tagFactory = new StandardTagFactory(m::mock(FqsenResolver::class));
|
$tagFactory = new StandardTagFactory(m::mock(FqsenResolver::class));
|
||||||
$tagFactory->create('@user[myuser');
|
$tagFactory->create('@user[myuser');
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user