You are here

public function ClientTest::testUsesCookies in Zircon Profile 8.0

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

File

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

Class

ClientTest
Goutte Client Test.

Namespace

Goutte\Tests

Code

public function testUsesCookies() {
  $guzzle = $this
    ->getGuzzle();
  $client = new Client();
  $client
    ->setClient($guzzle);
  $client
    ->getCookieJar()
    ->set(new Cookie('test', '123'));
  $client
    ->request('GET', 'http://www.example.com/');
  $request = end($this->history)['request'];
  $this
    ->assertEquals('test=123', $request
    ->getHeaderLine('Cookie'));
}