Skip to content

Commit 35f0631

Browse files
committed
Test for responses with only an HTTP status.
1 parent 86f0070 commit 35f0631

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

test.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,19 @@ public function test_multistatus_response(){
170170
], $api->headers);
171171
$this->assertEquals("body", $api->response);
172172
}
173+
174+
public function test_status_only_response(){
175+
$RESPONSE = "HTTP/1.1 100 Continue\r\n\r\n";
176+
177+
$api = new RestClient;
178+
// bypass request execution to inject controlled response data.
179+
$api->parse_response($RESPONSE);
180+
181+
$this->assertEquals(["HTTP/1.1 100 Continue"],
182+
$api->response_status_lines);
183+
$this->assertEquals((object) [], $api->headers);
184+
$this->assertEquals("", $api->response);
185+
}
173186
}
174187

175188

0 commit comments

Comments
 (0)