$this->
assertTrue($cookie->
isHttpOnly(), '->isHttpOnly() returns whether the cookie is only transmitted over HTTP'
);
$cookie = Cookie::
create('foo'
)->
withHttpOnly(true
);
$this->
assertTrue($cookie->
isHttpOnly(), '->isHttpOnly() returns whether the cookie is only transmitted over HTTP'
);
} public function testCookieIsNotCleared() { $cookie = Cookie::
create('foo', 'bar',
time() + 3600 * 24
);
$this->
assertFalse($cookie->
isCleared(), '->isCleared() returns false if the cookie did not expire yet'
);
$cookie = Cookie::
create('foo'
)->
withExpires(time() + 3600 * 24
);
$this->
assertFalse($cookie->
isCleared(), '->isCleared() returns false if the cookie did not expire yet'
);
} public function testCookieIsCleared() { $cookie = Cookie::
create('foo', 'bar',
time() - 20
);
$this->
assertTrue($cookie->
isCleared(), '->isCleared() returns true if the cookie has expired'
);