prepare v4.2.5
[m6w6/ext-http] / tests / encstream017.phpt
1 --TEST--
2 encoding stream brotli without flush
3 --SKIPIF--
4 <?php
5 include "skipif.inc";
6 class_exists("http\\Encoding\\Stream\\Enbrotli") or die("SKIP need brotli support");
7 ?>
8 --FILE--
9 <?php
10 echo "Test\n";
11
12 $defl = new http\Encoding\Stream\Enbrotli;
13 $infl = new http\Encoding\Stream\Debrotli;
14 $file = file(__FILE__);
15 $data = "";
16 foreach ($file as $line) {
17 if (strlen($temp = $defl->update($line))) {
18 foreach(str_split($temp) as $byte) {
19 $data .= $infl->update($byte);
20 }
21 }
22 }
23 if (strlen($temp = $defl->finish())) {
24 $data .= $infl->update($temp);
25 }
26 $data .= $infl->finish();
27 var_dump(implode("", $file) === $data);
28 ?>
29 DONE
30 --EXPECT--
31 Test
32 bool(true)
33 DONE