be more verbose about nghttp2 skip
[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 --INI--
13 always_populate_raw_post_data=-1
14 --FILE--
15 <?php
16 echo "Test\n";
17
18 use http\env\Request as HttpEnvRequest;
19
20 $m = new HttpEnvRequest();
21
22 // travis' env headers have another order, wtf?
23 $h = $m->getHeaders();
24 ksort($h);
25 $m->setHeaders($h);
26
27 var_dump($m);
28
29 echo "Message->toString\n";
30 echo $m,"\n";
31
32 echo "Body->toString\n";
33 var_dump((string)$m->getBody());
34
35 echo "stream\n";
36 var_dump(file_get_contents("php://input"));
37 ?>
38 Done
39 --EXPECTF--
40 Test
41 object(%s)#%d (13) {
42 ["type":protected]=>
43 int(1)
44 ["body":protected]=>
45 NULL
46 ["requestMethod":protected]=>
47 string(4) "POST"
48 ["requestUrl":protected]=>
49 string(0) ""
50 ["responseStatus":protected]=>
51 string(0) ""
52 ["responseCode":protected]=>
53 int(0)
54 ["httpVersion":protected]=>
55 string(3) "1.1"
56 ["headers":protected]=>
57 array(4) {
58 ["Content-Length"]=>
59 string(1) "3"
60 ["Content-Type"]=>
61 string(14) "test/something"
62 ["Cookie"]=>
63 string(7) "foo=bar"
64 ["X-Test"]=>
65 string(4) "test"
66 }
67 ["parentMessage":protected]=>
68 NULL
69 ["query":protected]=>
70 object(http\QueryString)#%d (1) {
71 ["queryArray":"http\QueryString":private]=>
72 array(0) {
73 }
74 }
75 ["form":protected]=>
76 object(http\QueryString)#%d (1) {
77 ["queryArray":"http\QueryString":private]=>
78 array(0) {
79 }
80 }
81 ["cookie":protected]=>
82 object(http\QueryString)#%d (1) {
83 ["queryArray":"http\QueryString":private]=>
84 array(1) {
85 ["foo"]=>
86 string(3) "bar"
87 }
88 }
89 ["files":protected]=>
90 array(0) {
91 }
92 }
93 Message->toString
94 POST / HTTP/1.1%a
95 Content-Length: 3%a
96 Content-Type: test/something%a
97 Cookie: foo=bar%a
98 X-Test: test%a
99 %a
100 b=c
101 Body->toString
102 string(3) "b=c"
103 stream
104 string(3) "b=c"
105 Done