From 07c49b0107f79289bd8dad07e7e733b78cb6d1bf Mon Sep 17 00:00:00 2001 From: Ondrej Mirtes Date: Thu, 9 Jun 2022 14:42:51 +0200 Subject: [PATCH] Regression test --- tests/PHPStan/Parser/PhpDocParserTest.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tests/PHPStan/Parser/PhpDocParserTest.php b/tests/PHPStan/Parser/PhpDocParserTest.php index df52c03..0a7a368 100644 --- a/tests/PHPStan/Parser/PhpDocParserTest.php +++ b/tests/PHPStan/Parser/PhpDocParserTest.php @@ -4392,4 +4392,22 @@ Finder::findFiles('*.php') $this->assertSame(Lexer::TOKEN_END, $tokens->currentTokenType()); } + public function testBug132(): void + { + $tokens = new TokenIterator($this->lexer->tokenize('/** + * @see \Symplify\SymfonyStaticDumper\Tests\Application\SymfonyStaticDumperApplicationTest + */')); + $phpDocNode = $this->phpDocParser->parse($tokens); + $this->assertSame('/** + * @see \Symplify\SymfonyStaticDumper\Tests\Application\SymfonyStaticDumperApplicationTest + */', $phpDocNode->__toString()); + + $seeNode = $phpDocNode->children[0]; + $this->assertInstanceOf(PhpDocTagNode::class, $seeNode); + $this->assertInstanceOf(GenericTagValueNode::class, $seeNode->value); + + $this->assertSame('@see \Symplify\SymfonyStaticDumper\Tests\Application\SymfonyStaticDumperApplicationTest', $seeNode->__toString()); + $this->assertSame('\Symplify\SymfonyStaticDumper\Tests\Application\SymfonyStaticDumperApplicationTest', $seeNode->value->__toString()); + } + }