Annotation of embedaddon/php/ext/zlib/tests/zlib_filter_inflate2.phpt, revision 1.1.1.2

1.1       misho       1: --TEST--
                      2: zlib.inflate of gzip-encoded stream
                      3: --SKIPIF--
                      4: <?php if (!extension_loaded("zlib")) print "skip"; ?>
                      5: --FILE--
1.1.1.2 ! misho       6: <?php /* $Id$ */
1.1       misho       7: 
                      8: $a = gzopen(dirname(__FILE__) . '/test.txt.gz', 'w');
1.1.1.2 ! misho       9: fwrite($a, b"This is quite the thing ain't it\n");
1.1       misho      10: fclose($a);
                     11: 
                     12: $fp = fopen(dirname(__FILE__) . '/test.txt.gz', 'r');
                     13: stream_filter_append($fp, 'zlib.inflate', STREAM_FILTER_READ);
                     14: echo fread($fp, 2000);
                     15: fclose($fp);
                     16: echo "1\n";
                     17: $fp = fopen(dirname(__FILE__) . '/test.txt.gz', 'r');
                     18: // zlib format
                     19: $fp = fopen(dirname(__FILE__) . '/test.txt.gz', 'r');
                     20: stream_filter_append($fp, 'zlib.inflate', STREAM_FILTER_READ, array('window' => 15+16));
                     21: echo "2\n";
                     22: echo fread($fp, 2000);
                     23: fclose($fp);
                     24: // auto-detect
                     25: $fp = fopen(dirname(__FILE__) . '/test.txt.gz', 'r');
                     26: stream_filter_append($fp, 'zlib.inflate', STREAM_FILTER_READ, array('window' => 15+32));
                     27: echo "3\n";
                     28: echo fread($fp, 2000);
                     29: fclose($fp);
                     30: 
                     31: ?>
                     32: --CLEAN--
                     33: <?php
                     34: @unlink(dirname(__FILE__) . '/test.txt.gz');
                     35: ?>
                     36: --EXPECT--
                     37: 1
                     38: 2
                     39: This is quite the thing ain't it
                     40: 3
1.1.1.2 ! misho      41: This is quite the thing ain't it

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>