public function browserHaltsOnAttemptedInfiniteRedirectionLoop()
{
$wildResponses = [];
$wildResponses[0] = new Http\Response();
$wildResponses[0]->setStatus(301);
$wildResponses[0]->setHeader('Location', 'http://localhost/pleaseGoThere');
$wildResponses[1] = new Http\Response();
$wildResponses[1]->setStatus(301);
$wildResponses[1]->setHeader('Location', 'http://localhost/ahNoPleaseRatherGoThere');
$wildResponses[2] = new Http\Response();
$wildResponses[2]->setStatus(301);
$wildResponses[2]->setHeader('Location', 'http://localhost/youNoWhatISendYouHere');
$wildResponses[3] = new Http\Response();
$wildResponses[3]->setStatus(301);
$wildResponses[3]->setHeader('Location', 'http://localhost/ahNoPleaseRatherGoThere');
$requestEngine = $this->createMock(Client\RequestEngineInterface::class);
for ($i = 0; $i <= 3; $i++) {
$requestEngine->expects($this->at($i))->method('sendRequest')->will($this->returnValue($wildResponses[$i]));
}
$this->browser->setRequestEngine($requestEngine);
$this->browser->request('http://localhost/mayThePaperChaseBegin');
}