public function testResultIsNotStoredIfExceptionIsThrown()
{
$this->callback->expects($this->exactly(2))->method('execute')->will($this->throwException(new BadMethodCallException('EXCEPTION')));
try {
memoize([$this->callback, 'execute']);
$this->fail('Expected failure');
} catch (BadMethodCallException $e) {
}
try {
memoize([$this->callback, 'execute']);
$this->fail('Expected failure');
} catch (BadMethodCallException $e) {
}
}