]> granicus.if.org Git - php/commitdiff
- PECL #11216 test
authorPierre Joye <pajoye@php.net>
Sun, 3 Jun 2007 19:50:36 +0000 (19:50 +0000)
committerPierre Joye <pajoye@php.net>
Sun, 3 Jun 2007 19:50:36 +0000 (19:50 +0000)
ext/zip/tests/bug11216.phpt [new file with mode: 0644]

diff --git a/ext/zip/tests/bug11216.phpt b/ext/zip/tests/bug11216.phpt
new file mode 100644 (file)
index 0000000..b5fa9b9
--- /dev/null
@@ -0,0 +1,27 @@
+--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'));
+var_dump($archive->addEmptyDir('test'));
+$archive->close();
+unlink('__test.zip');
+?>
+--EXPECT--
+bool(true)
+ZipArchive Object
+(
+    [status] => 0
+    [statusSys] => 0
+    [numFiles] => 1
+    [filename] =>
+    [comment] =>
+)
+bool(false)