function test_parse_response_parses_all_responses() { $client = new CurlHttpClient(); //Warning - the line endings in this string must be \r\n line endings. $server_response = 'HTTP/1.1 401 Unauthorized Via: 1.1 DORY Connection: Keep-Alive Proxy-Support: Session-Based-Authentication Connection: Proxy-Support Content-Length: 12 Date: Wed, 03 Oct 2007 00:15:59 GMT Content-Type: text/plain; charset=UTF-8 WWW-Authenticate: Digest realm="bigfoot", domain="null", nonce="8Q84YxUBAABJP5W9FaNm7Fli2QGGO99o", algorithm=MD5, qop="auth" HTTP/1.1 200 OK Via: 1.1 DORY Connection: Keep-Alive Proxy-Connection: Keep-Alive Content-Length: 3 Date: Wed, 03 Oct 2007 00:15:59 GMT content-type: text/html; charset=UTF-8 Server: Bigfoot/5.282.18209 Cache-Control: max-age=7200, must-revalidate foo'; list($response_code, $response_headers, $response_body) = $client->parse_response($server_response); $this->assertEquals(200, $response_code); }