public function testException()
{
eval('function testException($foo) { throw new \\Exception(); }');
$spy = new Spy(__NAMESPACE__, "testException");
$spy->enable();
try {
testException("foo");
$this->fail("Expected exception");
} catch (\Exception $e) {
$invocation = $spy->getInvocations()[0];
$this->assertEquals(["foo"], $invocation->getArguments());
$this->assertNull($invocation->getReturn());
$this->assertTrue($invocation->isExceptionThrown());
$this->assertEquals($e, $invocation->getException());
}
}