summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2020-02-03 10:21:46 +0100
committerRemi Collet <remi@php.net>2020-02-03 10:24:45 +0100
commit7fc06635c447d65c645cd5865606b6e18c560e8f (patch)
tree325d827dff510d3b3ca57f5037d7bb45b75ec048
parent846e52bd45ded95ceae441efc803b19deb8249f7 (diff)
downloadphp-git-7fc06635c447d65c645cd5865606b6e18c560e8f.tar.gz
add test
-rw-r--r--ext/zip/tests/oo_addemptydir_error.phpt30
-rw-r--r--ext/zip/tests/oo_namelocate.zipbin344 -> 0 bytes
2 files changed, 30 insertions, 0 deletions
diff --git a/ext/zip/tests/oo_addemptydir_error.phpt b/ext/zip/tests/oo_addemptydir_error.phpt
new file mode 100644
index 0000000000..a1b083ca50
--- /dev/null
+++ b/ext/zip/tests/oo_addemptydir_error.phpt
@@ -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
diff --git a/ext/zip/tests/oo_namelocate.zip b/ext/zip/tests/oo_namelocate.zip
deleted file mode 100644
index 9754e4c7bf..0000000000
--- a/ext/zip/tests/oo_namelocate.zip
+++ /dev/null
Binary files differ