X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=blobdiff_plain;f=tests%2FHttpMessage_001.phpt;h=ecdf22848a5e4061bcfa78527011e02fe177e38c;hp=d7e7ba9dd347f4f8e01a2fd5f3ef29544045ebc7;hb=1ff52a3e07565d94dab3eccb485aba28c0d10b84;hpb=3739156e5901eb81df2bd844abf301e08cd52405 diff --git a/tests/HttpMessage_001.phpt b/tests/HttpMessage_001.phpt index d7e7ba9..ecdf228 100644 --- a/tests/HttpMessage_001.phpt +++ b/tests/HttpMessage_001.phpt @@ -1,18 +1,19 @@ --TEST-- -HttpMessage simple redirects +HttpMessage --SKIPIF-- - (int) PHP_VERSION) and die('skip PHP5 is required for Http classes'); +checkmin("5.2.5"); ?> --FILE-- getResponseStatus()); + +$x = $m->getParentMessage(); +$x = $m->getParentMessage(); +$x = $m->getParentMessage(); + var_dump($m->getBody()); -var_dump($m->toString()); -var_dump(HttpMessage::fromString($m->toString())->toString()); +var_dump(HttpMessage::fromString($m->toString(true))->toString(true)); +try { + do { + var_dump($m->toString()); + } while ($m = $m->getParentMessage()); +} catch (HttpException $ex) { +} + +echo "Done\n"; ?> --EXPECTF-- -Content-type: text/html -X-Powered-By: PHP/%s - +%aTEST +string(15) "Partial content" string(1) "X" -string(134) "HTTP/1.1 301 +string(190) "HTTP/1.1 301 Location: /anywhere HTTP/1.1 302 -Location: /somwhere -HTTP/1.1 206 +Location: /somewhere +HTTP/1.1 206 Partial content Content-Range: bytes=2-3 +X-Original-Transfer-Encoding: chunked Content-Length: 1 X " -string(134) "HTTP/1.1 301 -Location: /anywhere -HTTP/1.1 302 -Location: /somwhere -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 X " +string(36) "HTTP/1.1 302 +Location: /somewhere +" +string(35) "HTTP/1.1 301 +Location: /anywhere +" +Done