- finish work on encoding api
[m6w6/ext-http] / tests / encoding_objects_001.phpt
1 --TEST--
2 encoding stream objects
3 --SKIPIF--
4 <?php
5 include 'skip.inc';
6 checkver(5);
7 skipif(!http_support(HTTP_SUPPORT_ENCODINGS), "need zlib");
8 ?>
9 --FILE--
10 <?php
11 echo "-TEST\n";
12 $d = new HttpDeflateStream;
13 $i = new HttpInflateStream;
14 echo $i->flush($d->flush("Hi "));
15 echo $i->finish($d->finish("there!\n"));
16 echo $i->finish($d->finish("Yo...\n"));
17
18 $id = $i->update($d->update($pd = file_get_contents(__FILE__)));
19 foreach (glob('*.phpt') as $f) {
20 $id .= $i->update($d->update($tmp = file_get_contents($f)));
21 $pd .= $tmp;
22 }
23 $id .= $i->finish($d->finish());
24
25 var_dump($id == $pd);
26
27 echo "Done\n";
28 ?>
29 --EXPECTF--
30 %sTEST
31 Hi there!
32 Yo...
33 bool(true)
34 Done
35