コード例 #1
0
ファイル: CookieStore.php プロジェクト: brick/http
 /**
  * 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);
     }
 }
コード例 #2
0
ファイル: ResponseTest.php プロジェクト: brick/http
 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());
 }