move to PHP-7.4 as current GA
[m6w6/ext-http] / tests / encstream016.phpt
1 --TEST--
2 encoding stream brotli auto flush
3 --SKIPIF--
4 <?php
5 include "skipif.inc";
6 class_exists("http\\Encoding\\Stream\\Enbrotli") or die("SKIP need brotli support");
7
8 ?>
9 --FILE--
10 <?php
11 echo "Test\n";
12
13 $defl = new http\Encoding\Stream\Enbrotli(http\Encoding\Stream::FLUSH_FULL);
14 $infl = new http\Encoding\Stream\Debrotli;
15
16 for ($f = fopen(__FILE__, "rb"); !feof($f); $data = fread($f, 0x100)) {
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 var_dump($infl->done(), $defl->done());
28 ?>
29 DONE
30 --EXPECT--
31 Test
32 bool(true)
33 bool(true)
34 DONE