$this->
assertEquals($expire->
format('U'
),
$cookie->
getExpiresTime(), '->getExpiresTime() returns the expire date'
);
} public function testConstructorWithDateTimeImmutable() { $expire =
new \
DateTimeImmutable();
$cookie = Cookie::
create('foo', 'bar',
$expire);
$this->
assertEquals($expire->
format('U'
),
$cookie->
getExpiresTime(), '->getExpiresTime() returns the expire date'
);
$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'
);