$this->
assertEquals('foo=bar; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/; httponly',
(string) $cookie);
$cookie =
new Cookie('foo', 'bar', 2, '/', '', true, true, false, 'lax'
);
$this->
assertEquals('foo=bar; expires=Thu, 01 Jan 1970 00:00:02 GMT; path=/; secure; httponly; samesite=lax',
(string) $cookie);
} /**
* @dataProvider getTestsForToFromString
*/
public function testToFromString($cookie,
$url = null
) { $this->
assertEquals($cookie,
(string) Cookie::
fromString($cookie,
$url));
} public static function getTestsForToFromString() { return [ ['foo=bar; path=/'
],
['foo=bar; path=/foo'
],
['foo="Test"; path=/'
],
['foo=bar; domain=example.com; path=/'
],
['foo=bar; domain=example.com; path=/; secure', 'https://example.com/'
],
['foo=bar; path=/; httponly'
],
[