Annotation of embedaddon/php/ext/zlib/tests/zlib_scheme_copy_basic.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Test compress.zlib:// scheme with the copy function: compressed to compressed
! 3: --SKIPIF--
! 4: <?php
! 5: if (!extension_loaded("zlib")) {
! 6: print "skip - ZLIB extension not loaded";
! 7: }
! 8: ?>
! 9: --FILE--
! 10: <?php
! 11: $inputFileName = dirname(__FILE__)."/004.txt.gz";
! 12: $outputFileName = __FILE__.'.tmp';
! 13:
! 14: $srcFile = "compress.zlib://$inputFileName";
! 15: $destFile = "compress.zlib://$outputFileName";
! 16: copy($srcFile, $destFile);
! 17:
! 18: $h = gzopen($inputFileName, 'r');
! 19: $org_data = gzread($h, 4096);
! 20: gzclose($h);
! 21:
! 22: $h = gzopen($outputFileName, 'r');
! 23: $copied_data = gzread($h, 4096);
! 24: gzclose($h);
! 25:
! 26: if ($org_data == $copied_data) {
! 27: echo "OK: Copy identical\n";
! 28: }
! 29: else {
! 30: echo "FAILED: Copy not identical";
! 31: }
! 32: unlink($outputFileName);
! 33: ?>
! 34: ===DONE===
! 35: --EXPECT--
! 36: OK: Copy identical
! 37: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>