bug8009.phpt 456 B

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