public function testVariableResolver()
{
$source = <<<'EOC'
<?php
namespace Foo;
class Bar
{
function a() {
}
function b() {
$this->a();
$x = new Bar1();
$x->a();
$x->b();
$c = new Bar2();
$y = $c;
$f = $y;
$f->a();
}
}
EOC;
$fileInfo = PhpFileInfo::create($this->prophesize('Symfony\\Component\\Finder\\SplFileInfo')->reveal());
$contents = $this->traverseSourceAndReturnContents($source, $fileInfo);
$methodUsages = $contents->methodUsages();
$this->assertCount(4, $methodUsages);
$this->assertEquals(new MethodUsage('a', 'Foo\\Bar', 8, false), $methodUsages[0]);
$this->assertEquals(new MethodUsage('a', 'Bar1', 10, false), $methodUsages[1]);
$this->assertEquals(new MethodUsage('b', 'Bar1', 11, false), $methodUsages[2]);
$this->assertEquals(new MethodUsage('a', 'Bar2', 15, false), $methodUsages[3]);
}