- CURLOPT_COOKIELIST needs curl 7.15
[m6w6/ext-http] / tests / stream_filters_002.phpt
1 --TEST--
2 gzip stream filters
3 --SKIPIF--
4 <?php
5 include 'skip.inc';
6 checkver(5);
7 skipif(!http_support(HTTP_SUPPORT_ENCODINGS), "need zlib support");
8 ?>
9 --FILE--
10 <?php
11
12 echo "-TEST\n";
13
14 $d = file_get_contents(__FILE__);
15 $n = tempnam(dirname(__FILE__), 'hsf');
16
17 $f = fopen($n, 'wb');
18 stream_filter_append($f, 'http.deflate', STREAM_FILTER_WRITE, HTTP_DEFLATE_TYPE_GZIP);
19 fwrite($f, $d);
20 fclose($f);
21 var_dump($d == http_inflate(file_get_contents($n)));
22
23 $f = fopen($n, 'wb');
24 stream_filter_append($f, 'http.deflate', STREAM_FILTER_WRITE);
25 fwrite($f, $d);
26 fclose($f);
27 var_dump($d == http_inflate(file_get_contents($n)));
28
29 $f = fopen($n, 'wb');
30 stream_filter_append($f, 'http.deflate', STREAM_FILTER_WRITE, HTTP_DEFLATE_TYPE_RAW);
31 fwrite($f, $d);
32 fclose($f);
33 var_dump($d == http_inflate(file_get_contents($n)));
34
35 unlink($n);
36
37 echo "Done\n";
38 ?>
39 --EXPECTF--
40 %sTEST
41 bool(true)
42 bool(true)
43 bool(true)
44 Done