xref: /PHP-5.3/ext/zip/tests/bug11216.phpt (revision 7478cead)
1--TEST--
2Bug #11216 (::addEmptyDir() crashes when the directory already exists)
3--SKIPIF--
4<?php
5/* $Id$ */
6if(!extension_loaded('zip')) die('skip');
7 ?>
8--FILE--
9<?php
10$archive = new ZipArchive();
11$archive->open('__test.zip', ZIPARCHIVE::CREATE);
12var_dump($archive->addEmptyDir('test'));
13print_r($archive);
14var_dump($archive->addEmptyDir('test'));
15$archive->close();
16unlink('__test.zip');
17?>
18--EXPECTF--
19bool(true)
20ZipArchive Object
21(
22    [status] => 0
23    [statusSys] => 0
24    [numFiles] => 1
25    [filename] => %s
26    [comment] =>
27)
28bool(false)
29