$this->
assertArrayHasKey('Accept-Language',
$server);
$this->
assertSame('de',
$server['Accept-Language'
]);
} public function testFollowRedirect() { $client =
$this->
getBrowser();
$client->
followRedirects(false
);
$client->
request('GET', 'http://www.example.com/foo/foobar'
);
try { $client->
followRedirect();
$this->
fail('->followRedirect() throws a \LogicException if the request was not redirected'
);
} catch (\Exception
$e) { $this->
assertInstanceOf(\LogicException::
class,
$e, '->followRedirect() throws a \LogicException if the request was not redirected'
);
} $client->
setNextResponse(new Response('', 302,
['Location' => 'http://www.example.com/redirected'
]));
$client->
request('GET', 'http://www.example.com/foo/foobar'
);
$client->
followRedirect();
$this->
assertSame('http://www.example.com/redirected',
$client->
getRequest()->
getUri(), '->followRedirect() follows a redirect if any'
);