public function CookieJarTest::testUpdateFromSetCookie in Zircon Profile 8.0
Same name and namespace in other branches
- 8 vendor/symfony/browser-kit/Tests/CookieJarTest.php \Symfony\Component\BrowserKit\Tests\CookieJarTest::testUpdateFromSetCookie()
File
- vendor/
symfony/ browser-kit/ Tests/ CookieJarTest.php, line 71
Class
Namespace
Symfony\Component\BrowserKit\TestsCode
public function testUpdateFromSetCookie() {
$setCookies = array(
'foo=foo',
);
$cookieJar = new CookieJar();
$cookieJar
->set(new Cookie('bar', 'bar'));
$cookieJar
->updateFromSetCookie($setCookies);
$this
->assertInstanceOf('Symfony\\Component\\BrowserKit\\Cookie', $cookieJar
->get('foo'));
$this
->assertInstanceOf('Symfony\\Component\\BrowserKit\\Cookie', $cookieJar
->get('bar'));
$this
->assertEquals('foo', $cookieJar
->get('foo')
->getValue(), '->updateFromSetCookie() updates cookies from a Set-Cookie header');
$this
->assertEquals('bar', $cookieJar
->get('bar')
->getValue(), '->updateFromSetCookie() keeps existing cookies');
}