create(ParserFactory::PREFER_PHP7); } public function setUp() { $config = new TestConfig(); FileChecker::clearCache(); } public function testAccessiblePrivateMethodFromTrait() { $stmts = self::$parser->parse('fooFoo(); } } '); $file_checker = new FileChecker('somefile.php', $stmts); $file_checker->check(); } public function testAccessibleProtectedMethodFromTrait() { $stmts = self::$parser->parse('fooFoo(); } } '); $file_checker = new FileChecker('somefile.php', $stmts); $file_checker->check(); } public function testAccessiblePublicMethodFromTrait() { $stmts = self::$parser->parse('fooFoo(); } } '); $file_checker = new FileChecker('somefile.php', $stmts); $file_checker->check(); } /** * @expectedException \Psalm\Exception\CodeException * @expectedExceptionMessage UndefinedMethod */ public function testInccessiblePrivateMethodFromInheritedTrait() { $stmts = self::$parser->parse('fooFoo(); } } '); $file_checker = new FileChecker('somefile.php', $stmts); $file_checker->check(); } public function testAccessibleProtectedMethodFromInheritedTrait() { $stmts = self::$parser->parse('fooFoo(); } } '); $file_checker = new FileChecker('somefile.php', $stmts); $file_checker->check(); } public function testAccessiblePublicMethodFromInheritedTrait() { $stmts = self::$parser->parse('fooFoo(); } } '); $file_checker = new FileChecker('somefile.php', $stmts); $file_checker->check(); } public function testStaticClassMethodFromWithinTrait() { $stmts = self::$parser->parse('check(); } /** * @expectedException \Psalm\Exception\CodeException * @expectedExceptionMessage UndefinedTrait */ public function testUndefinedTrait() { $stmts = self::$parser->parse('check(); } }