You are here

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

File

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

Class

CookieJarTest

Namespace

Symfony\Component\BrowserKit\Tests

Code

public function testCookieGetWithSubdirectory() {
  $cookieJar = new CookieJar();
  $cookieJar
    ->set($cookie1 = new Cookie('foo', 'bar', null, '/test', '.example.com'));
  $cookieJar
    ->set($cookie2 = new Cookie('foo1', 'bar1', null, '/', '.example.com'));
  $this
    ->assertNull($cookieJar
    ->get('foo', '/', '.example.com'));
  $this
    ->assertNull($cookieJar
    ->get('foo', '/bar', '.example.com'));
  $this
    ->assertEquals($cookie1, $cookieJar
    ->get('foo', '/test', 'example.com'));
  $this
    ->assertEquals($cookie2, $cookieJar
    ->get('foo1', '/', 'example.com'));
  $this
    ->assertEquals($cookie2, $cookieJar
    ->get('foo1', '/bar', 'example.com'));
}