diff --git a/tests/Php70Test.php b/tests/Php70Test.php new file mode 100644 index 000000000..0f619fced --- /dev/null +++ b/tests/Php70Test.php @@ -0,0 +1,77 @@ +create(ParserFactory::PREFER_PHP7); + + $config = \Psalm\Config::getInstance(); + $config->throw_exception = true; + $config->use_docblock_types = true; + } + + public function setUp() + { + \Psalm\Checker\FileChecker::clearCache(); + } + + public function testFunctionTypeHints() + { + $stmts = self::$_parser->parse('check(true, true, $context); + $this->assertEquals('int', (string) $context->vars_in_scope['$a']); + } + + public function testMethodTypeHints() + { + $stmts = self::$_parser->parse('check(true, true, $context); + $this->assertEquals('int', (string) $context->vars_in_scope['$a']); + } +}