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