You are here

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

File

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

Class

CookieJarTest

Namespace

Symfony\Component\BrowserKit\Tests

Code

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