/** * Updates the cookie store from a Request/Response pair. * * @param Request $request * @param Response $response * * @return void */ public function update(Request $request, Response $response) { $origin = CookieOrigin::createFromRequest($request); foreach ($response->getCookies() as $cookie) { $this->addCookie($cookie, $origin); } }
public function testDefaults() { $response = new Response(); $this->assertSame('HTTP/1.0 200 OK', $response->getStartLine()); $this->assertSame('1.0', $response->getProtocolVersion()); $this->assertSame(200, $response->getStatusCode()); $this->assertSame('OK', $response->getReasonPhrase()); $this->assertSame([], $response->getHeaders()); $this->assertSame([], $response->getCookies()); $this->assertNull($response->getBody()); }