You are here

public function CookieJarTest::testCookieWithSameNameButDifferentPaths in Zircon Profile 8

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

File

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

Class

CookieJarTest

Namespace

Symfony\Component\BrowserKit\Tests

Code

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