/**
* Tests spying.
*
* @param array $expected
* @param string $name
* @param callable $invocations
*
* @test
* @dataProvider provideTestGetInvocations
*/
public function testGetInvocations(array $expected, $name, callable $invocations)
{
$spy = new Spy(__NAMESPACE__, $name);
$spy->enable();
call_user_func($invocations);
$this->assertEquals($expected, $spy->getInvocations());
}