You are here

public function CookieJarTest::testCookieWithSameNameButDifferentDomains in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/symfony/browser-kit/Tests/CookieJarTest.php \Symfony\Component\BrowserKit\Tests\CookieJarTest::testCookieWithSameNameButDifferentDomains()

File

vendor/symfony/browser-kit/Tests/CookieJarTest.php, line 188

Class

CookieJarTest

Namespace

Symfony\Component\BrowserKit\Tests

Code

public function testCookieWithSameNameButDifferentDomains() {
  $cookieJar = new CookieJar();
  $cookieJar
    ->set($cookie1 = new Cookie('foo', 'bar1', null, '/', 'foo.example.com'));
  $cookieJar
    ->set($cookie2 = new Cookie('foo', 'bar2', null, '/', 'bar.example.com'));
  $this
    ->assertEquals(array(), array_keys($cookieJar
    ->allValues('http://example.com/')));
  $this
    ->assertEquals(array(
    'foo' => 'bar1',
  ), $cookieJar
    ->allValues('http://foo.example.com/'));
  $this
    ->assertEquals(array(
    'foo' => 'bar2',
  ), $cookieJar
    ->allValues('http://bar.example.com/'));
}