Test"; $options = array( 'transport' => $transport ); $response = Requests::get('http://example.com/', array(), $options); } /** * HTTP/0.9 also appears to use a single CRLF instead of two * * @expectedException Requests_Exception */ public function testSingleCRLFSeparator() { $transport = new RawTransport(); $transport->data = "HTTP/0.9 200 OK\r\n
Test"; $options = array( 'transport' => $transport ); $response = Requests::get('http://example.com/', array(), $options); } /** * @expectedException Requests_Exception */ public function testInvalidStatus() { $transport = new RawTransport(); $transport->data = "HTTP/1.1 OK\r\nTest: value\nAnother-Test: value\r\n\r\nTest"; $options = array( 'transport' => $transport ); $response = Requests::get('http://example.com/', array(), $options); } public function test30xWithoutLocation() { $transport = new MockTransport(); $transport->code = 302; $options = array( 'transport' => $transport ); $response = Requests::get('http://example.com/', array(), $options); $this->assertEquals(302, $response->status_code); $this->assertEquals(0, $response->redirects); } }