duh, test before commit!; remove errenous additional CRLF on php_http_message_to_stri...
[m6w6/ext-http] / tests / message002.phpt
1 --TEST--
2 env request Message
3 --SKIPIF--
4 <?php include "skipif.inc"; ?>
5 --POST_RAW--
6 Content-Type: test/something
7 b=c
8 --ENV--
9 HTTP_X_TEST=test
10 --COOKIE--
11 foo=bar
12 --FILE--
13 <?
14 echo "Test\n";
15
16 use http\env\Request as HttpEnvRequest;
17
18 $m = new HttpEnvRequest();
19
20 var_dump($m);
21 echo $m,"\n";
22
23 var_dump((string)$m->getBody());
24
25 echo "Done\n";
26 --EXPECTF--
27 Test
28 object(%s)#%d (13) {
29 ["errorHandling":protected]=>
30 NULL
31 ["type":protected]=>
32 int(1)
33 ["body":protected]=>
34 object(%s)#%d (1) {
35 ["errorHandling":protected]=>
36 NULL
37 }
38 ["requestMethod":protected]=>
39 string(4) "POST"
40 ["requestUrl":protected]=>
41 string(0) ""
42 ["responseStatus":protected]=>
43 string(0) ""
44 ["responseCode":protected]=>
45 int(0)
46 ["httpVersion":protected]=>
47 string(3) "1.1"
48 ["headers":protected]=>
49 array(4) {
50 ["X-Test"]=>
51 string(4) "test"
52 ["Content-Length"]=>
53 string(1) "3"
54 ["Content-Type"]=>
55 string(14) "test/something"
56 ["Cookie"]=>
57 string(7) "foo=bar"
58 }
59 ["parentMessage":protected]=>
60 NULL
61 ["query":protected]=>
62 object(http\QueryString)#2 (2) {
63 ["errorHandling":protected]=>
64 NULL
65 ["queryArray":"http\QueryString":private]=>
66 array(0) {
67 }
68 }
69 ["post":protected]=>
70 object(http\QueryString)#3 (2) {
71 ["errorHandling":protected]=>
72 NULL
73 ["queryArray":"http\QueryString":private]=>
74 array(0) {
75 }
76 }
77 ["files":protected]=>
78 array(0) {
79 }
80 }
81 POST / HTTP/1.1%a
82 X-Test: test%a
83 Content-Length: 3%a
84 Content-Type: test/something%a
85 Cookie: foo=bar%a
86 %a
87 b=c
88 string(3) "b=c"
89 Done