public function testHandlesRedirectsCorrectly()
{
$guzzle = $this->getGuzzle([new GuzzleResponse(301, array('Location' => 'http://www.example.com/')), new GuzzleResponse(200, [], '<html><body><p>Test</p></body></html>')]);
$client = new Client();
$client->setClient($guzzle);
$crawler = $client->request('GET', 'http://www.example.com/');
$this->assertEquals('Test', $crawler->filter('p')->text());
// Ensure that two requests were sent
$this->assertEquals(2, count($this->history));
}