$cookie = Cookie::
create('foo'
)->
withValue('bar'
)->
withExpires($expire);
$this->
assertEquals($expire->
format('U'
),
$cookie->
getExpiresTime(), '->getExpiresTime() returns the expire date'
);
} public function testGetExpiresTimeWithStringValue() { $value = '+1 day';
$cookie = Cookie::
create('foo', 'bar',
$value);
$expire =
strtotime($value);
$this->
assertEqualsWithDelta($expire,
$cookie->
getExpiresTime(), 1, '->getExpiresTime() returns the expire date'
);
$cookie = Cookie::
create('foo'
)->
withValue('bar'
)->
withExpires($value);
$this->
assertEqualsWithDelta($expire,
$cookie->
getExpiresTime(), 1, '->getExpiresTime() returns the expire date'
);
} public function testGetDomain() { $cookie = Cookie::
create('foo', 'bar', 0, '/', '.myfoodomain.com'
);
$this->
assertEquals('.myfoodomain.com',
$cookie->
getDomain(), '->getDomain() returns the domain name on which the cookie is valid'
);