branch off v1 as R_1_7
[m6w6/ext-http] / tests / HttpMessage_001.phpt
index 6791bc336173fbe926742eb48c5714356eec315d..ecdf22848a5e4061bcfa78527011e02fe177e38c 100644 (file)
@@ -3,7 +3,7 @@ HttpMessage
 --SKIPIF--
 <?php
 include 'skip.inc';
-checkmin(5);
+checkmin("5.2.5");
 ?>
 --FILE--
 <?php
@@ -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
+%aTEST
+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