Merge branch 'master' into phpng
[m6w6/ext-http] / tests / encstream006.phpt
1 --TEST--
2 encoding stream zlib auto 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(http\Encoding\Stream::FLUSH_FULL);
12 $infl = new http\Encoding\Stream\Inflate;
13
14 for ($f = fopen(__FILE__, "rb"); !feof($f); $data = fread($f, 0x100)) {
15 $infl = clone $infl;
16 $defl = clone $defl;
17 if (isset($data)) {
18 if ($data !== $d=$infl->update($defl->update($data))) {
19 printf("uh-oh »%s« != »%s«\n", $data, $d);
20 }
21 }
22 }
23
24 echo $infl->update($defl->finish());
25 echo $infl->finish();
26 ?>
27 DONE
28 --EXPECT--
29 Test
30 DONE