示例#1
0
 /**
  * Test we can build a new object from a response object (multiple cookie headers)
  */
 public function testFromResponseMultiHeader()
 {
     $res_str = file_get_contents(dirname(realpath(__FILE__)) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'response_with_cookies');
     $response = Response\Response::fromString($res_str);
     $jar = HTTP\CookieJar::fromResponse($response, 'http://www.example.com');
     $this->assertTrue($jar instanceof HTTP\CookieJar, '$jar is not an instance of CookieJar as expected');
     $this->assertEquals(3, count($jar->getAllCookies()), 'CookieJar expected to contain 3 cookies');
 }