X-Git-Url: http://aleph1.co.uk/gitweb/?a=blobdiff_plain;f=vendor%2Fsymfony%2Fbrowser-kit%2FTests%2FClientTest.php;h=bbaceb0c329627bb4265bd24acbf9209da993373;hb=5b8bb166bfa98770daef9de5c127fc2e6ef02340;hp=5bd4dad7b6ecba7051c33d4c6686d0db7f903db0;hpb=eba34333e3c89f208d2f72fa91351ad019a71583;p=yaffs-website diff --git a/vendor/symfony/browser-kit/Tests/ClientTest.php b/vendor/symfony/browser-kit/Tests/ClientTest.php index 5bd4dad7b..bbaceb0c3 100644 --- a/vendor/symfony/browser-kit/Tests/ClientTest.php +++ b/vendor/symfony/browser-kit/Tests/ClientTest.php @@ -13,8 +13,8 @@ namespace Symfony\Component\BrowserKit\Tests; use PHPUnit\Framework\TestCase; use Symfony\Component\BrowserKit\Client; -use Symfony\Component\BrowserKit\History; use Symfony\Component\BrowserKit\CookieJar; +use Symfony\Component\BrowserKit\History; use Symfony\Component\BrowserKit\Response; class SpecialResponse extends Response @@ -573,6 +573,25 @@ class ClientTest extends TestCase $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();