Annotation of embedaddon/php/ext/zlib/tests/zlib_wrapper_meta_data_basic.phpt, revision 1.1.1.1

1.1       misho       1: --TEST--
                      2: Test function stream_get_meta_data on a zlib stream
                      3: --SKIPIF--
                      4: <?php 
                      5: if (!extension_loaded("zlib")) {
                      6:        print "skip - ZLIB extension not loaded"; 
                      7: }
                      8: ?>
                      9: --FILE--
                     10: <?php
                     11: echo "no wrapper\n";
                     12: $f = dirname(__FILE__)."/004.txt.gz";
                     13: $h = gzopen($f,'r');   
                     14: var_dump(stream_get_meta_data($h));
                     15: gzclose($h);
                     16: echo "\nwith wrapper\n";
                     17: $f = "compress.zlib://".dirname(__FILE__)."/004.txt.gz";
                     18: $h = fopen($f,'r');    
                     19: var_dump(stream_get_meta_data($h));
                     20: gzclose($h);
                     21: 
                     22: 
                     23: ?>
                     24: ===DONE===
                     25: --EXPECTF--
                     26: no wrapper
                     27: array(7) {
                     28:   ["stream_type"]=>
                     29:   string(4) "ZLIB"
                     30:   ["mode"]=>
                     31:   string(1) "r"
                     32:   ["unread_bytes"]=>
                     33:   int(0)
                     34:   ["seekable"]=>
                     35:   bool(true)
                     36:   ["timed_out"]=>
                     37:   bool(false)
                     38:   ["blocked"]=>
                     39:   bool(true)
                     40:   ["eof"]=>
                     41:   bool(false)
                     42: }
                     43: 
                     44: with wrapper
                     45: array(9) {
                     46:   ["wrapper_type"]=>
                     47:   string(4) "ZLIB"
                     48:   ["stream_type"]=>
                     49:   string(4) "ZLIB"
                     50:   ["mode"]=>
                     51:   string(1) "r"
                     52:   ["unread_bytes"]=>
                     53:   int(0)
                     54:   ["seekable"]=>
                     55:   bool(true)
                     56:   ["uri"]=>
                     57:   string(%d) "compress.zlib://%s/004.txt.gz"
                     58:   ["timed_out"]=>
                     59:   bool(false)
                     60:   ["blocked"]=>
                     61:   bool(true)
                     62:   ["eof"]=>
                     63:   bool(false)
                     64: }
                     65: ===DONE===

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