You are here

public function ClientTest::testCustomUserAgent in Zircon Profile 8.0

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

File

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

Class

ClientTest
Goutte Client Test.

Namespace

Goutte\Tests

Code

public function testCustomUserAgent() {
  $guzzle = $this
    ->getGuzzle();
  $client = new Client();
  $client
    ->setClient($guzzle);
  $client
    ->setHeader('User-Agent', 'foo');
  $client
    ->request('GET', 'http://www.example.com/');
  $this
    ->assertEquals('Symfony2 BrowserKit, foo', end($this->history)['request']
    ->getHeaderLine('User-Agent'));
}