public function CookieJarTest::testSetGet 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::testSetGet()
File
- vendor/
symfony/ browser-kit/ Tests/ CookieJarTest.php, line 20
Class
Namespace
Symfony\Component\BrowserKit\TestsCode
public function testSetGet() {
$cookieJar = new CookieJar();
$cookieJar
->set($cookie = new Cookie('foo', 'bar'));
$this
->assertEquals($cookie, $cookieJar
->get('foo'), '->set() sets a cookie');
$this
->assertNull($cookieJar
->get('foobar'), '->get() returns null if the cookie does not exist');
$cookieJar
->set($cookie = new Cookie('foo', 'bar', time() - 86400));
$this
->assertNull($cookieJar
->get('foo'), '->get() returns null if the cookie is expired');
}