public function testProtectedApiStartLoop_CallsFailMethod_WhenLoopThrowsException()
{
$loop = $this->getMock(Loop::class, [], [], '', false);
$loop->expects($this->once())->method('start')->will($this->throwException($ex = new Exception()));
$runtime = $this->createModel([], ['getLoop', 'fail']);
$runtime->expects($this->once())->method('getLoop')->will($this->returnValue($loop));
$runtime->expects($this->once())->method('fail')->with($ex);
$next = RuntimeModel::LOOP_STATE_STARTED;
$this->setProtectedProperty($runtime, 'loopNextState', [$next]);
$this->callProtectedMethod($runtime, 'startLoop');
}