create(ParserFactory::PREFER_PHP7); $config = new TestConfig(); $config->throw_exception = true; $config->use_docblock_types = true; } public function setUp() { FileChecker::clearCache(); } public function testExtendsAndImplements() { $stmts = self::$parser->parse('baz(); $dee = (new D())->foo(); ?> '); $file_checker = new FileChecker('somefile.php', $stmts); $context = new Context('somefile.php'); $file_checker->check(true, true, $context); $this->assertEquals('string', (string) $context->vars_in_scope['$cee']); $this->assertEquals('string', (string) $context->vars_in_scope['$dee']); } public function testIsExtendedInterface() { $stmts = self::$parser->parse(' '); $file_checker = new FileChecker('somefile.php', $stmts); $context = new Context('somefile.php'); $file_checker->check(true, true, $context); } public function testExtendsWithMethod() { $stmts = self::$parser->parse('foo(); } ?> '); $file_checker = new FileChecker('somefile.php', $stmts); $context = new Context('somefile.php'); $file_checker->check(true, true, $context); } }