$cookie = Cookie::
create('foo'
)->
withSecure(true
);
$this->
assertTrue($cookie->
isSecure(), '->isSecure() returns whether the cookie is transmitted over HTTPS'
);
} public function testIsHttpOnly() { $cookie = Cookie::
create('foo', 'bar', 0, '/', '.myfoodomain.com', false, true
);
$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
);