You are here

public function ClientTest::testCustomUserAgentConstructor in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/fabpot/goutte/Goutte/Tests/ClientTest.php \Goutte\Tests\ClientTest::testCustomUserAgentConstructor()

File

vendor/fabpot/goutte/Goutte/Tests/ClientTest.php, line 364

Class

ClientTest
Goutte Client Test.

Namespace

Goutte\Tests

Code

public function testCustomUserAgentConstructor() {
  $guzzle = $this
    ->getGuzzle();
  $client = new Client([
    'HTTP_HOST' => '1.2.3.4',
    'HTTP_USER_AGENT' => 'SomeHost',
  ]);
  $client
    ->setClient($guzzle);
  $client
    ->request('GET', 'http://www.example.com/');
  $this
    ->assertEquals('SomeHost', end($this->history)['request']
    ->getHeaderLine('User-Agent'));
}