a76e9e54a16d4cb616e830684ed5dc288f50f259
[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;
22
23 var_dump((string)$m->getBody());
24
25 echo "Done\n";
26 --EXPECTF--
27 Test
28 object(%s)#%d (10) {
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(2) {
50 ["X-Test"]=>
51 string(4) "test"
52 ["Cookie"]=>
53 string(7) "foo=bar"
54 }
55 ["parentMessage":protected]=>
56 NULL
57 }
58 POST / HTTP/1.1%a
59 X-Test: test%a
60 Cookie: foo=bar%a
61 %a
62 b=c%a
63 string(3) "b=c"
64 Done