public function persistAllReconnectsConnectionOnFailure()
{
$this->mockEntityManager->expects($this->exactly(2))->method('flush')->will($this->throwException(new FlowError\Exception('Dummy connection error')));
$this->mockConnection->expects($this->at(0))->method('close');
$this->mockConnection->expects($this->at(1))->method('connect');
$this->persistenceManager->persistAll();
}