mirror of
https://github.com/barryvdh/ReflectionDocBlock.git
synced 2026-08-18 01:57:13 +00:00
Add testcase for invalid tag creation
This commit is contained in:
@@ -18,6 +18,7 @@ use phpDocumentor\Reflection\DocBlock\Tags\Author;
|
|||||||
use phpDocumentor\Reflection\DocBlock\Tags\Formatter;
|
use phpDocumentor\Reflection\DocBlock\Tags\Formatter;
|
||||||
use phpDocumentor\Reflection\DocBlock\Tags\Formatter\PassthroughFormatter;
|
use phpDocumentor\Reflection\DocBlock\Tags\Formatter\PassthroughFormatter;
|
||||||
use phpDocumentor\Reflection\DocBlock\Tags\Generic;
|
use phpDocumentor\Reflection\DocBlock\Tags\Generic;
|
||||||
|
use phpDocumentor\Reflection\DocBlock\Tags\InvalidTag;
|
||||||
use phpDocumentor\Reflection\DocBlock\Tags\Return_;
|
use phpDocumentor\Reflection\DocBlock\Tags\Return_;
|
||||||
use phpDocumentor\Reflection\DocBlock\Tags\See;
|
use phpDocumentor\Reflection\DocBlock\Tags\See;
|
||||||
use phpDocumentor\Reflection\Fqsen;
|
use phpDocumentor\Reflection\Fqsen;
|
||||||
@@ -330,4 +331,14 @@ class StandardTagFactoryTest extends TestCase
|
|||||||
$this->assertInstanceOf(Return_::class, $tag);
|
$this->assertInstanceOf(Return_::class, $tag);
|
||||||
$this->assertSame('return', $tag->getName());
|
$this->assertSame('return', $tag->getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function testInvalidTagIsReturnedOnFailure()
|
||||||
|
{
|
||||||
|
$tagFactory = new StandardTagFactory(m::mock(FqsenResolver::class));
|
||||||
|
|
||||||
|
/** @var InvalidTag $tag */
|
||||||
|
$tag = $tagFactory->create('@see $name some invalid tag');
|
||||||
|
|
||||||
|
$this->assertInstanceOf(InvalidTag::class, $tag);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user