php-src/ext/zlib/tests/zlib_scheme_copy_basic.phpt
Gina Peter Banyard 5bd18e3fdc
ext/zlib: Refactor tests (#18887)
- Use INI sections
- Use CGI sections
- Move data into a subfolder
- Remove ZPP tests
- Fix various bugs within tests
- Simplify some


Found while working on #18879
2025-06-21 18:03:50 +01:00

31 lines
656 B
PHP

--TEST--
Test compress.zlib:// scheme with the copy function: compressed to compressed
--EXTENSIONS--
zlib
--FILE--
<?php
$inputFileName = __DIR__."/data/test.txt.gz";
$outputFileName = __FILE__.'.tmp';
$srcFile = "compress.zlib://$inputFileName";
$destFile = "compress.zlib://$outputFileName";
copy($srcFile, $destFile);
$h = gzopen($inputFileName, 'r');
$org_data = gzread($h, 4096);
gzclose($h);
$h = gzopen($outputFileName, 'r');
$copied_data = gzread($h, 4096);
gzclose($h);
if ($org_data == $copied_data) {
echo "OK: Copy identical\n";
}
else {
echo "FAILED: Copy not identical";
}
unlink($outputFileName);
?>
--EXPECT--
OK: Copy identical