/**
* It should throw an exception if getStats is called when an exception has been set.
*
* @expectedException RuntimeException
* @expectedExceptionMessage Cannot retrieve stats when an exception
*/
public function testGetStatsWithExceptionException()
{
$variant = new Variant($this->subject->reveal(), $this->parameterSet->reveal(), 4, 20);
$this->subject->getRetryThreshold()->willReturn(10);
$variant->createIteration(TestUtil::createResults(4, 10));
$variant->createIteration(TestUtil::createResults(4, 10));
$variant->createIteration(TestUtil::createResults(4, 10));
$variant->createIteration(TestUtil::createResults(4, 10));
$variant->computeStats();
$variant->setException(new \Exception('Test'));
$variant->getStats();
}