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