- fix tests
[m6w6/ext-http] / tests / HttpMessage_001.phpt
1 --TEST--
2 HttpMessage
3 --SKIPIF--
4 <?php
5 include 'skip.inc';
6 checkver(5);
7 ?>
8 --FILE--
9 <?php
10 $m = new HttpMessage(
11 "HTTP/1.1 301\r\n".
12 "Location: /anywhere\r\n".
13 "HTTP/1.1 302\r\n".
14 "Location: /somwhere\r\n".
15 "HTTP/1.1 206\r\n".
16 "Content-Range: bytes=2-3\r\n".
17 "Transfer-Encoding: chunked\r\n".
18 "\r\n".
19 "01\r\n".
20 "X\r\n".
21 "00"
22 );
23
24 var_dump($m->getBody());
25 var_dump($m->toString());
26 var_dump(HttpMessage::fromString($m->toString())->toString());
27 ?>
28 --EXPECTF--
29 %sstring(1) "X"
30 string(134) "HTTP/1.1 301
31 Location: /anywhere
32 HTTP/1.1 302
33 Location: /somwhere
34 HTTP/1.1 206
35 Content-Range: bytes=2-3
36 Content-Length: 1
37
38 X
39 "
40 string(134) "HTTP/1.1 301
41 Location: /anywhere
42 HTTP/1.1 302
43 Location: /somwhere
44 HTTP/1.1 206
45 Content-Range: bytes=2-3
46 Content-Length: 1
47
48 X
49 "