- fix PHP4 build (has no only_exceptions INI setting
[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 echo "-TEST\n";
11 $m = new HttpMessage(
12 "HTTP/1.1 301\r\n".
13 "Location: /anywhere\r\n".
14 "HTTP/1.1 302\r\n".
15 "Location: /somwhere\r\n".
16 "HTTP/1.1 206\r\n".
17 "Content-Range: bytes=2-3\r\n".
18 "Transfer-Encoding: chunked\r\n".
19 "\r\n".
20 "01\r\n".
21 "X\r\n".
22 "00"
23 );
24
25 var_dump($m->getBody());
26 var_dump($m->toString());
27 var_dump(HttpMessage::fromString($m->toString())->toString());
28 ?>
29 --EXPECTF--
30 %sTEST
31 string(1) "X"
32 string(134) "HTTP/1.1 301
33 Location: /anywhere
34 HTTP/1.1 302
35 Location: /somwhere
36 HTTP/1.1 206
37 Content-Range: bytes=2-3
38 Content-Length: 1
39
40 X
41 "
42 string(134) "HTTP/1.1 301
43 Location: /anywhere
44 HTTP/1.1 302
45 Location: /somwhere
46 HTTP/1.1 206
47 Content-Range: bytes=2-3
48 Content-Length: 1
49
50 X
51 "
52