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

1.1       misho       1: --TEST--
                      2: Test gzopen() function : variation: relative/absolute file 
                      3: --SKIPIF--
                      4: <?php 
                      5: if (!extension_loaded("zlib")) {
                      6:        print "skip - ZLIB extension not loaded"; 
                      7: }       
                      8: ?>
                      9: --FILE--
                     10: <?php
                     11: /* Prototype  : resource gzopen(string filename, string mode [, int use_include_path])
                     12:  * Description: Open a .gz-file and return a .gz-file pointer 
                     13:  * Source code: ext/zlib/zlib.c
                     14:  * Alias to functions: 
                     15:  */
                     16: 
                     17: echo "*** Testing gzopen() : variation ***\n";
                     18: $absfile = __FILE__.'.tmp';
                     19: $relfile = "gzopen_variation6.tmp";
                     20: 
                     21: $h = gzopen($absfile, "w");
                     22: gzwrite($h, "This is an absolute file");
                     23: gzclose($h);
                     24: 
                     25: $h = gzopen($relfile, "w");
                     26: gzwrite($h, "This is a relative file");
                     27: gzclose($h);
                     28: 
                     29: $h = gzopen($absfile, "r");
                     30: gzpassthru($h);
                     31: fclose($h);
                     32: echo "\n";
                     33: 
                     34: $h = gzopen($relfile, "r");
                     35: gzpassthru($h);
                     36: gzclose($h);
                     37: echo "\n";
                     38: 
                     39: unlink($absfile);
                     40: unlink($relfile);
                     41: ?>
                     42: ===DONE===
                     43: --EXPECTF--
                     44: *** Testing gzopen() : variation ***
                     45: This is an absolute file
                     46: This is a relative file
                     47: ===DONE===

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