Annotation of embedaddon/php/ext/zlib/tests/gzfile_basic.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Test function gzfile() reading a gzip relative file
! 3: --SKIPIF--
! 4: <?php
! 5: if (!extension_loaded('zlib')) die ('skip zlib extension not available in this build');
! 6: ?>
! 7: --FILE--
! 8: <?php
! 9: $plaintxt = b<<<EOT
! 10: hello world
! 11: is a very common test
! 12: for all languages
! 13: EOT;
! 14: $dirname = 'gzfile_temp';
! 15: $filename = $dirname.'/plainfile.txt.gz';
! 16: mkdir($dirname);
! 17: $h = gzopen($filename, 'w');
! 18: gzwrite($h, $plaintxt);
! 19: gzclose($h);
! 20:
! 21:
! 22: var_dump(gzfile( $filename ) );
! 23:
! 24: unlink($filename);
! 25: rmdir($dirname);
! 26: ?>
! 27: ===DONE===
! 28: --EXPECT--
! 29: array(3) {
! 30: [0]=>
! 31: string(12) "hello world
! 32: "
! 33: [1]=>
! 34: string(22) "is a very common test
! 35: "
! 36: [2]=>
! 37: string(17) "for all languages"
! 38: }
! 39: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>