add more logging
[m6w6/ext-http] / tests / encstream008.phpt
1 --TEST--
2 encoding stream zlib with explicit flush
3 --SKIPIF--
4 <?php
5 include "skipif.inc";
6 ?>
7 --FILE--
8 <?php
9 echo "Test\n";
10
11 $defl = new http\Encoding\Stream\Deflate;
12 $infl = new http\Encoding\Stream\Inflate;
13 $file = file(__FILE__);
14 $data = "";
15 foreach ($file as $line) {
16 $data .= $infl->flush();
17 if (strlen($temp = $defl->update($line))) {
18 $data .= $infl->update($temp);
19 $data .= $infl->flush();
20 }
21 if (strlen($temp = $defl->flush())) {
22 $data .= $infl->update($temp);
23 $data .= $infl->flush();
24 }
25 $defl->done() or printf("uh-oh stream's not done yet!\n");
26 }
27 if (strlen($temp = $defl->finish())) {
28 $data .= $infl->update($temp);
29 }
30 var_dump($defl->done());
31 $data .= $infl->finish();
32 var_dump($infl->done());
33 var_dump(implode("", $file) === $data);
34
35 ?>
36 DONE
37 --EXPECT--
38 Test
39 bool(true)
40 bool(true)
41 bool(true)
42 DONE