You are here

public function ClientTest::testRequestCookies 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::testRequestCookies()

File

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

Class

ClientTest

Namespace

Symfony\Component\BrowserKit\Tests

Code

public function testRequestCookies() {
  $client = new TestClient();
  $client
    ->setNextResponse(new Response('<html><a href="/foo">foo</a></html>', 200, array(
    'Set-Cookie' => 'foo=bar',
  )));
  $client
    ->request('GET', 'http://www.example.com/foo/foobar');
  $this
    ->assertEquals(array(
    'foo' => 'bar',
  ), $client
    ->getCookieJar()
    ->allValues('http://www.example.com/foo/foobar'), '->request() updates the CookieJar');
  $client
    ->request('GET', 'bar');
  $this
    ->assertEquals(array(
    'foo' => 'bar',
  ), $client
    ->getCookieJar()
    ->allValues('http://www.example.com/foo/foobar'), '->request() updates the CookieJar');
}