Skip to content

Commit fc79f19

Browse files
committed
Test about PhpDocNode exporting to file
1 parent 972c2c4 commit fc79f19

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tests/PHPStan/Parser/PhpDocParserTest.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@
7373
use PHPUnit\Framework\TestCase;
7474
use function count;
7575
use function sprintf;
76+
use function var_export;
7677
use const DIRECTORY_SEPARATOR;
7778
use const PHP_EOL;
7879

@@ -151,6 +152,10 @@ private function executeTestParse(PhpDocParser $phpDocParser, string $label, str
151152
$this->assertEquals($expectedPhpDocNode, $actualPhpDocNode, $label);
152153
$this->assertSame((string) $expectedPhpDocNode, (string) $actualPhpDocNode, $label);
153154
$this->assertSame(Lexer::TOKEN_END, $tokens->currentTokenType(), $label);
155+
156+
$serialized = var_export($actualPhpDocNode, true);
157+
$readData = eval('return ' . $serialized . ';');
158+
$this->assertEquals($actualPhpDocNode, $readData);
154159
}
155160

156161
public function provideParamTagsData(): Iterator

0 commit comments

Comments
 (0)