mirror of
https://github.com/php/php-src.git
synced 2024-12-18 14:30:35 +08:00
add test
This commit is contained in:
parent
846e52bd45
commit
7fc06635c4
30
ext/zip/tests/oo_addemptydir_error.phpt
Normal file
30
ext/zip/tests/oo_addemptydir_error.phpt
Normal file
@ -0,0 +1,30 @@
|
||||
--TEST--
|
||||
ziparchive::addEmptyDir error
|
||||
--SKIPIF--
|
||||
<?php
|
||||
/* $Id$ */
|
||||
if(!extension_loaded('zip')) die('skip');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
include __DIR__ . '/utils.inc';
|
||||
|
||||
$zip = new ZipArchive;
|
||||
if (!$zip->open(__DIR__ . '/test.zip', ZipArchive::RDONLY)) {
|
||||
exit('failed');
|
||||
}
|
||||
|
||||
var_dump($zip->addEmptyDir('emptydir'));
|
||||
if ($zip->status == ZipArchive::ER_RDONLY) {
|
||||
echo "OK\n";
|
||||
} else if ($zip->status == ZipArchive::ER_OK) {
|
||||
dump_entries_name($zip);
|
||||
} else {
|
||||
echo "Lost\n";
|
||||
}
|
||||
$zip->close();
|
||||
?>
|
||||
--EXPECTF--
|
||||
bool(false)
|
||||
OK
|
Binary file not shown.
Loading…
Reference in New Issue
Block a user