php-src/ext/zlib/tests/gzclose_basic.phpt
Nikita Popov 7485978339
Migrate SKIPIF -> EXTENSIONS (#7138)
This is an automated migration of most SKIPIF extension_loaded checks.
2021-06-11 11:57:42 +02:00

39 lines
720 B
PHP

--TEST--
Test function gzclose() by calling it with its expected arguments
--EXTENSIONS--
zlib
--FILE--
<?php
// note that gzclose is an alias to fclose. parameter checking tests will be
// the same as fclose
$f = __DIR__."/004.txt.gz";
$h = gzopen($f, 'r');
gzread($h, 20);
var_dump(gzclose($h));
//should fail.
try {
gzread($h, 20);
} catch (TypeError $e) {
echo $e->getMessage(), "\n";
}
$h = gzopen($f, 'r');
gzread($h, 20);
var_dump(fclose($h));
//should fail.
try {
gzread($h, 20);
} catch (TypeError $e) {
echo $e->getMessage(), "\n";
}
?>
--EXPECT--
bool(true)
gzread(): supplied resource is not a valid stream resource
bool(true)
gzread(): supplied resource is not a valid stream resource