1
0
mirror of https://github.com/php/php-src.git synced 2026-04-20 14:31:06 +02:00
Files
archived-php-src/ext/zip/tests/zip_entry_close.phpt
Nikita Popov 1df8175b61 Convert fetch_resource warnings into TypeErrors
More type checks that are not part of zpp and should generate a
TypeError in PHP 8.
2019-06-03 09:17:12 +02:00

26 lines
639 B
PHP

--TEST--
zip_entry_close() function: simple and double call
--SKIPIF--
<?php
if(!extension_loaded('zip')) die('skip');
?>
--FILE--
<?php
$zip = zip_open(__DIR__."/test_procedural.zip");
$entry = zip_read($zip);
echo "entry_open: "; var_dump(zip_entry_open($zip, $entry, "r"));
echo "entry_close: "; var_dump(zip_entry_close($entry));
try {
echo "entry_close: "; var_dump(zip_entry_close($entry));
} catch (TypeError $e) {
echo $e->getMessage(), "\n";
}
zip_close($zip);
?>
Done
--EXPECT--
entry_open: bool(true)
entry_close: bool(true)
entry_close: zip_entry_close(): supplied resource is not a valid Zip Entry resource
Done