You are here

public function CookieJarTest::testCookieExpireWithSameNameButDifferentPaths 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::testCookieExpireWithSameNameButDifferentPaths()

File

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

Class

CookieJarTest

Namespace

Symfony\Component\BrowserKit\Tests

Code

public function testCookieExpireWithSameNameButDifferentPaths() {
  $cookieJar = new CookieJar();
  $cookieJar
    ->set($cookie1 = new Cookie('foo', 'bar1', null, '/foo'));
  $cookieJar
    ->set($cookie2 = new Cookie('foo', 'bar2', null, '/bar'));
  $cookieJar
    ->expire('foo', '/foo');
  $this
    ->assertNull($cookieJar
    ->get('foo'), '->get() returns null if the cookie is expired');
  $this
    ->assertEquals(array(), array_keys($cookieJar
    ->allValues('http://example.com/')));
  $this
    ->assertEquals(array(), $cookieJar
    ->allValues('http://example.com/foo'));
  $this
    ->assertEquals(array(
    'foo' => 'bar2',
  ), $cookieJar
    ->allValues('http://example.com/bar'));
}