From d964f96439339f594777667a6d86a529fe62b536 Mon Sep 17 00:00:00 2001 From: Matthew Brown Date: Sat, 30 Dec 2017 10:42:06 -0500 Subject: [PATCH] Add test that analyses a class with a mapped property --- phpunit.xml.dist | 2 ++ tests/PropertyTypeTest.php | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 2425f21df..e3ae1fcad 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -39,6 +39,8 @@ ./src/Psalm/Stubs/ ./src/Psalm/CallMap.php ./src/psalm.php + ./src/Psalm/Provider/Cache/NoParserCacheProvider.php + ./src/Psalm/Provider/ParserCacheProvider.php ./src/Psalm/PropertyMap.php ./src/Psalm/Issue/ diff --git a/tests/PropertyTypeTest.php b/tests/PropertyTypeTest.php index 55e2caa5f..196d8d52b 100644 --- a/tests/PropertyTypeTest.php +++ b/tests/PropertyTypeTest.php @@ -611,6 +611,38 @@ class PropertyTypeTest extends TestCase public function __construct() { } }', ], + 'analyzePropertyMappedClass' => [ + 'stmts = $stmts; + } + + public function getSubNodeNames() { + return array("stmts"); + } + }', + 'assertions' => [], + 'error_levels' => [ + 'InvalidPropertyAssignment', + 'MissingReturnType', + ], + ], ]; }