X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=blobdiff_plain;f=tests%2FHttpMessage_001.phpt;h=e787523b2f20a57ebbb15906ee6db1502771f225;hp=6791bc336173fbe926742eb48c5714356eec315d;hb=c4bf0a26f53d88dc8724d96e599a3867113da2be;hpb=33b7c5dcd9cffebb8486cb57e04958e34bbfe662 diff --git a/tests/HttpMessage_001.phpt b/tests/HttpMessage_001.phpt index 6791bc3..e787523 100644 --- a/tests/HttpMessage_001.phpt +++ b/tests/HttpMessage_001.phpt @@ -13,7 +13,7 @@ $m = new HttpMessage( "Location: /anywhere\r\n". "HTTP/1.1 302\r\n". "Location: /somewhere\r\n". - "HTTP/1.1 206\r\n". + "HTTP/1.1 206 Partial content\r\n". "Content-Range: bytes=2-3\r\n". "Transfer-Encoding: chunked\r\n". "\r\n". @@ -22,29 +22,39 @@ $m = new HttpMessage( "00" ); +var_dump($m->getResponseStatus()); + +$x = $m->getParentMessage(); +$x = $m->getParentMessage(); +$x = $m->getParentMessage(); + var_dump($m->getBody()); var_dump(HttpMessage::fromString($m->toString(true))->toString(true)); -do { - var_dump($m->toString()); -} while ($m = $m->getParentMessage()); +try { + do { + var_dump($m->toString()); + } while ($m = $m->getParentMessage()); +} catch (HttpException $ex) { +} echo "Done\n"; ?> --EXPECTF-- %sTEST +string(15) "Partial content" string(1) "X" -string(174) "HTTP/1.1 301 +string(190) "HTTP/1.1 301 Location: /anywhere HTTP/1.1 302 Location: /somewhere -HTTP/1.1 206 +HTTP/1.1 206 Partial content Content-Range: bytes=2-3 X-Original-Transfer-Encoding: chunked Content-Length: 1 X " -string(103) "HTTP/1.1 206 +string(119) "HTTP/1.1 206 Partial content Content-Range: bytes=2-3 X-Original-Transfer-Encoding: chunked Content-Length: 1