diff --git a/tests/unit/DocBlock/StandardTagFactoryTest.php b/tests/unit/DocBlock/StandardTagFactoryTest.php index 5e4ee4c..25542f9 100644 --- a/tests/unit/DocBlock/StandardTagFactoryTest.php +++ b/tests/unit/DocBlock/StandardTagFactoryTest.php @@ -18,6 +18,7 @@ use phpDocumentor\Reflection\DocBlock\Tags\Author; use phpDocumentor\Reflection\DocBlock\Tags\Formatter; use phpDocumentor\Reflection\DocBlock\Tags\Formatter\PassthroughFormatter; use phpDocumentor\Reflection\DocBlock\Tags\Generic; +use phpDocumentor\Reflection\DocBlock\Tags\InvalidTag; use phpDocumentor\Reflection\DocBlock\Tags\Return_; use phpDocumentor\Reflection\DocBlock\Tags\See; use phpDocumentor\Reflection\Fqsen; @@ -330,4 +331,14 @@ class StandardTagFactoryTest extends TestCase $this->assertInstanceOf(Return_::class, $tag); $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); + } }