From ba7df7e6217b4078e8656251a61ea9cb33f77672 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20Fr=C3=B6mer?= Date: Mon, 4 May 2020 15:56:40 +0200 Subject: [PATCH] Add test for docblock parsing --- tests/PHPStan/Parser/PhpDocParserTest.php | 24 +++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/tests/PHPStan/Parser/PhpDocParserTest.php b/tests/PHPStan/Parser/PhpDocParserTest.php index e834ae8..11f22b0 100644 --- a/tests/PHPStan/Parser/PhpDocParserTest.php +++ b/tests/PHPStan/Parser/PhpDocParserTest.php @@ -3054,6 +3054,30 @@ chunk. Must be higher that in the previous request.'), new PhpDocTagNode('@param', new InvalidTagValueNode('Foo::** $a', new \PHPStan\PhpDocParser\Parser\ParserException('*', Lexer::TOKEN_WILDCARD, 17, Lexer::TOKEN_VARIABLE))), ]), ]; + + yield [ + 'multiline generic types', + '/**' . PHP_EOL . + ' * @implements Foo<' . PHP_EOL . + ' * A, B' . PHP_EOL . + ' * >' . PHP_EOL . + ' */', + new PhpDocNode([ + new PhpDocTagNode( + '@implements', + new ImplementsTagValueNode( + new GenericTypeNode( + new IdentifierTypeNode('Foo'), + [ + new IdentifierTypeNode('A'), + new IdentifierTypeNode('B'), + ] + ), + '' + ) + ), + ]), + ]; } public function dataParseTagValue(): array