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

1.1       misho       1: --TEST--
                      2: Test function gzwrite() by calling it when file is opened for reading
                      3: --SKIPIF--
                      4: <?php 
                      5: if (!extension_loaded("zlib")) {
                      6:        print "skip - ZLIB extension not loaded"; 
                      7: }
                      8: ?>
                      9: --FILE--
                     10: <?php
                     11: 
                     12: $filename = dirname(__FILE__)."/004.txt.gz";
                     13: $h = gzopen($filename, 'r');
1.1.1.2 ! misho      14: $str = b"Here is the string to be written. ";
1.1       misho      15: $length = 10;
                     16: var_dump(gzwrite( $h, $str ) );
                     17: var_dump(gzread($h, 10));
                     18: var_dump(gzwrite( $h, $str, $length ) );
                     19: gzclose($h);
                     20: 
                     21: ?>
                     22: ===DONE===
                     23: --EXPECT--
                     24: int(0)
                     25: string(10) "When you'r"
                     26: int(0)
                     27: ===DONE===

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