예제 #1
0
 public function testExpire()
 {
     $cookieJar = new CookieJar();
     $cookieJar->set($cookie = new Cookie('foo', 'bar'));
     $cookieJar->expire('foo');
     $this->assertNull($cookieJar->get('foo'), '->get() returns null if the cookie is expired');
 }
예제 #2
0
 public function testCookieExpireWithNullPaths()
 {
     $cookieJar = new CookieJar();
     $cookieJar->set($cookie1 = new Cookie('foo', 'bar1', null, '/'));
     $cookieJar->expire('foo', null);
     $this->assertNull($cookieJar->get('foo'), '->get() returns null if the cookie is expired');
     $this->assertEquals(array(), array_keys($cookieJar->allValues('http://example.com/')));
 }