Merge branch 'master' into phpng
[m6w6/ext-http] / tests / envresponse008.phpt
1 --TEST--
2 env response stream message
3 --SKIPIF--
4 <?php include "skipif.inc"; ?>
5 --ENV--
6 HTTP_ACCEPT_ENCODING=gzip
7 --FILE--
8 <?php
9
10 $f = tmpfile();
11
12 $r = new http\env\Response;
13 $r->setHeader("foo","bar");
14 $r->setContentEncoding(http\env\Response::CONTENT_ENCODING_GZIP);
15 $r->setBody(new http\message\Body(fopen(__FILE__,"r")));
16 $r->send($f);
17
18 rewind($f);
19 var_dump(stream_get_contents($f));
20
21 ?>
22 --EXPECTREGEX--
23 string\(\d+\) "HTTP\/1\.1 200 OK
24 Accept-Ranges: bytes
25 Foo: bar
26 Content-Encoding: gzip
27 Vary: Accept-Encoding
28 ETag: "\w+-\w+-\w+"
29 Last-Modified: \w+, \d+ \w+ \d{4} \d\d:\d\d:\d\d GMT
30 Transfer-Encoding: chunked
31
32 d0
33 \x1f\x8b\x08.+
34 0
35
36 "