xref: /PHP-8.3/ext/zip/tests/bug8009.phpt (revision 74859783)
1--TEST--
2Bug #8009 (cannot add again same entry to an archive)
3--EXTENSIONS--
4zip
5--FILE--
6<?php
7$thisdir = __DIR__;
8$src = $thisdir . "/bug8009.zip";
9$filename = $thisdir . "/tmp8009.zip";
10copy($src, $filename);
11
12$zip = new ZipArchive();
13
14if (!$zip->open($filename)) {
15       exit("cannot open $filename\n");
16}
17$zip->addFromString("2.txt", "=)");
18$zip->close();
19unlink($filename);
20echo "status: " . $zip->status . "\n";
21echo "\n";
22?>
23--EXPECT--
24status: 0
25