$this->assertEquals($content, $client->getRequest()->getContent(), '->forward() keeps content');
}
+ public function testBackAndFrowardWithRedirects()
+ {
+ $client = new TestClient();
+
+ $client->request('GET', 'http://www.example.com/foo');
+ $client->setNextResponse(new Response('', 301, array('Location' => 'http://www.example.com/redirected')));
+ $client->request('GET', 'http://www.example.com/bar');
+
+ $this->assertEquals('http://www.example.com/redirected', $client->getRequest()->getUri(), 'client followed redirect');
+
+ $client->back();
+
+ $this->assertEquals('http://www.example.com/foo', $client->getRequest()->getUri(), '->back() goes back in the history skipping redirects');
+
+ $client->forward();
+
+ $this->assertEquals('http://www.example.com/redirected', $client->getRequest()->getUri(), '->forward() goes forward in the history skipping redirects');
+ }
+
public function testReload()
{
$client = new TestClient();