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