String str = "<?php class MyClass { public $myvar = \"test\"; public function mymethod(){ return $this->myvar; }} $a = new MyClass(); $a->mymethod();?>";
Program program = createAndParse(str);
ExpressionStatement statement = (ExpressionStatement) program
.statements().get(2);
MethodInvocation methodInvocation = (MethodInvocation) statement
.getExpression();
IMethodBinding methodBinding = methodInvocation.resolveMethodBinding();
Assert.assertNotNull(methodBinding);
Assert.assertTrue(methodBinding.getName().equals("mymethod"));
Assert.assertNotNull(methodBinding.getDeclaringClass());
Assert.assertTrue(methodBinding.getDeclaringClass().getName()