$cookieJar->
clear();
$this->
assertEquals([],
$cookieJar->
all(), '->clear() expires all cookies'
);
} public function testUpdateFromResponse() { $response =
new Response('', 200,
['Set-Cookie' => 'foo=foo'
]);
$cookieJar =
new CookieJar();
$cookieJar->
updateFromResponse($response);
$this->
assertEquals('foo',
$cookieJar->
get('foo'
)->
getValue(), '->updateFromResponse() updates cookies from a Response objects'
);
} public function testUpdateFromSetCookie() { $setCookies =
['foo=foo'
];
$cookieJar =
new CookieJar();
$cookieJar->
set(new Cookie('bar', 'bar'
));
$cookieJar->
updateFromSetCookie($setCookies);