public function ClientTest::testFollowRelativeRedirect in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/symfony/browser-kit/Tests/ClientTest.php \Symfony\Component\BrowserKit\Tests\ClientTest::testFollowRelativeRedirect()
File
- vendor/
symfony/ browser-kit/ Tests/ ClientTest.php, line 384
Class
Namespace
Symfony\Component\BrowserKit\TestsCode
public function testFollowRelativeRedirect() {
$client = new TestClient();
$client
->setNextResponse(new Response('', 302, array(
'Location' => '/redirected',
)));
$client
->request('GET', 'http://www.example.com/foo/foobar');
$this
->assertEquals('http://www.example.com/redirected', $client
->getRequest()
->getUri(), '->followRedirect() follows a redirect if any');
$client = new TestClient();
$client
->setNextResponse(new Response('', 302, array(
'Location' => '/redirected:1234',
)));
$client
->request('GET', 'http://www.example.com/foo/foobar');
$this
->assertEquals('http://www.example.com/redirected:1234', $client
->getRequest()
->getUri(), '->followRedirect() follows relative urls');
}