summaryrefslogtreecommitdiff
path: root/ext/zip/tests/bug11216.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'ext/zip/tests/bug11216.phpt')
-rw-r--r--ext/zip/tests/bug11216.phpt28
1 files changed, 28 insertions, 0 deletions
diff --git a/ext/zip/tests/bug11216.phpt b/ext/zip/tests/bug11216.phpt
new file mode 100644
index 0000000..7601e6a
--- /dev/null
+++ b/ext/zip/tests/bug11216.phpt
@@ -0,0 +1,28 @@
+--TEST--
+Bug #11216 (::addEmptyDir() crashes when the directory already exists)
+--SKIPIF--
+<?php
+/* $Id$ */
+if(!extension_loaded('zip')) die('skip');
+ ?>
+--FILE--
+<?php
+$archive = new ZipArchive();
+$archive->open('__test.zip', ZIPARCHIVE::CREATE);
+var_dump($archive->addEmptyDir('test'));
+print_r($archive);
+var_dump($archive->addEmptyDir('test'));
+$archive->close();
+unlink('__test.zip');
+?>
+--EXPECTF--
+bool(true)
+ZipArchive Object
+(
+ [status] => 0
+ [statusSys] => 0
+ [numFiles] => 1
+ [filename] => %s
+ [comment] =>
+)
+bool(false)