$cookie =
new Cookie('foo', 'bar'
);
$this->
assertFalse($cookie->
isSecure(), '->isSecure() returns false if not defined'
);
$cookie =
new Cookie('foo', 'bar', 0, '/', 'foo.com', true
);
$this->
assertTrue($cookie->
isSecure(), '->isSecure() returns the cookie secure flag'
);
} public function testIsHttponly() { $cookie =
new Cookie('foo', 'bar'
);
$this->
assertTrue($cookie->
isHttpOnly(), '->isHttpOnly() returns false if not defined'
);
$cookie =
new Cookie('foo', 'bar', 0, '/', 'foo.com', false, true
);
$this->
assertTrue($cookie->
isHttpOnly(), '->isHttpOnly() returns the cookie httponly flag'
);
} public function testGetExpiresTime() { $cookie =
new Cookie('foo', 'bar'
);
$this->
assertNull($cookie->
getExpiresTime(), '->getExpiresTime() returns the expires time'
);
$cookie =
new Cookie('foo', 'bar',
$time =
time() - 86400
);