You are here

public function CookieTest::testFromStringWithUrl in Zircon Profile 8

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

File

vendor/symfony/browser-kit/Tests/CookieTest.php, line 75

Class

CookieTest

Namespace

Symfony\Component\BrowserKit\Tests

Code

public function testFromStringWithUrl() {
  $this
    ->assertEquals('foo=bar; domain=www.example.com; path=/', (string) Cookie::fromString('foo=bar', 'http://www.example.com/'));
  $this
    ->assertEquals('foo=bar; domain=www.example.com; path=/', (string) Cookie::fromString('foo=bar', 'http://www.example.com'));
  $this
    ->assertEquals('foo=bar; domain=www.example.com; path=/', (string) Cookie::fromString('foo=bar', 'http://www.example.com?foo'));
  $this
    ->assertEquals('foo=bar; domain=www.example.com; path=/foo', (string) Cookie::fromString('foo=bar', 'http://www.example.com/foo/bar'));
  $this
    ->assertEquals('foo=bar; domain=www.example.com; path=/', (string) Cookie::fromString('foo=bar; path=/', 'http://www.example.com/foo/bar'));
  $this
    ->assertEquals('foo=bar; domain=www.myotherexample.com; path=/', (string) Cookie::fromString('foo=bar; domain=www.myotherexample.com', 'http://www.example.com/'));
}