projects
/
m6w6
/
ext-http
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
- don't call into ext/zlib any longer
[m6w6/ext-http]
/
tests
/
HttpMessage_001.phpt
diff --git
a/tests/HttpMessage_001.phpt
b/tests/HttpMessage_001.phpt
index d7e7ba9dd347f4f8e01a2fd5f3ef29544045ebc7..6791bc336173fbe926742eb48c5714356eec315d 100644
(file)
--- a/
tests/HttpMessage_001.phpt
+++ b/
tests/HttpMessage_001.phpt
@@
-1,17
+1,18
@@
--TEST--
--TEST--
-HttpMessage
simple redirects
+HttpMessage
--SKIPIF--
--SKIPIF--
-<?php
+<?php
include 'skip.inc';
include 'skip.inc';
-
(5 > (int) PHP_VERSION) and die('skip PHP5 is required for Http classes'
);
+
checkmin(5
);
?>
--FILE--
<?php
?>
--FILE--
<?php
+echo "-TEST\n";
$m = new HttpMessage(
"HTTP/1.1 301\r\n".
"Location: /anywhere\r\n".
"HTTP/1.1 302\r\n".
$m = new HttpMessage(
"HTTP/1.1 301\r\n".
"Location: /anywhere\r\n".
"HTTP/1.1 302\r\n".
- "Location: /somwhere\r\n".
+ "Location: /som
e
where\r\n".
"HTTP/1.1 206\r\n".
"Content-Range: bytes=2-3\r\n".
"Transfer-Encoding: chunked\r\n".
"HTTP/1.1 206\r\n".
"Content-Range: bytes=2-3\r\n".
"Transfer-Encoding: chunked\r\n".
@@
-22,31
+23,38
@@
$m = new HttpMessage(
);
var_dump($m->getBody());
);
var_dump($m->getBody());
-var_dump($m->toString());
-var_dump(HttpMessage::fromString($m->toString())->toString());
+var_dump(HttpMessage::fromString($m->toString(true))->toString(true));
+do {
+ var_dump($m->toString());
+} while ($m = $m->getParentMessage());
+
+echo "Done\n";
?>
--EXPECTF--
?>
--EXPECTF--
-Content-type: text/html
-X-Powered-By: PHP/%s
-
+%sTEST
string(1) "X"
string(1) "X"
-string(1
3
4) "HTTP/1.1 301
+string(1
7
4) "HTTP/1.1 301
Location: /anywhere
HTTP/1.1 302
Location: /anywhere
HTTP/1.1 302
-Location: /somwhere
+Location: /som
e
where
HTTP/1.1 206
Content-Range: bytes=2-3
HTTP/1.1 206
Content-Range: bytes=2-3
+X-Original-Transfer-Encoding: chunked
Content-Length: 1
X
"
Content-Length: 1
X
"
-string(134) "HTTP/1.1 301
-Location: /anywhere
-HTTP/1.1 302
-Location: /somwhere
-HTTP/1.1 206
+string(103) "HTTP/1.1 206
Content-Range: bytes=2-3
Content-Range: bytes=2-3
+X-Original-Transfer-Encoding: chunked
Content-Length: 1
X
"
Content-Length: 1
X
"
+string(36) "HTTP/1.1 302
+Location: /somewhere
+"
+string(35) "HTTP/1.1 301
+Location: /anywhere
+"
+Done