Add parse error test

This commit is contained in:
Arnaud Le Blanc 2019-06-04 20:22:42 +02:00 committed by Ondřej Mirtes
parent 9b27b84656
commit 8c4ef2aefd

View File

@ -447,6 +447,24 @@ class TypeParserTest extends \PHPUnit\Framework\TestCase
Lexer::TOKEN_CLOSE_CURLY_BRACKET
),
],
[
'array{"a": int}',
new \PHPStan\PhpDocParser\Parser\ParserException(
'"a"',
Lexer::TOKEN_DOUBLE_QUOTED_STRING,
6,
Lexer::TOKEN_IDENTIFIER
),
],
[
'array{\'a\': int}',
new \PHPStan\PhpDocParser\Parser\ParserException(
'\'a\'',
Lexer::TOKEN_SINGLE_QUOTED_STRING,
6,
Lexer::TOKEN_IDENTIFIER
),
],
[
'callable(): Foo',
new CallableTypeNode(