You are here

public function ClientTest::testFollowRedirectWithPort in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/browser-kit/Tests/ClientTest.php \Symfony\Component\BrowserKit\Tests\ClientTest::testFollowRedirectWithPort()

File

vendor/symfony/browser-kit/Tests/ClientTest.php, line 477

Class

ClientTest

Namespace

Symfony\Component\BrowserKit\Tests

Code

public function testFollowRedirectWithPort() {
  $headers = array(
    'HTTP_HOST' => 'www.example.com:8080',
    'HTTP_USER_AGENT' => 'Symfony2 BrowserKit',
    'HTTPS' => false,
    'HTTP_REFERER' => 'http://www.example.com:8080/',
  );
  $client = new TestClient();
  $client
    ->setNextResponse(new Response('', 302, array(
    'Location' => 'http://www.example.com:8080/redirected',
  )));
  $client
    ->request('GET', 'http://www.example.com:8080/');
  $this
    ->assertEquals($headers, $client
    ->getRequest()
    ->getServer());
}