bug8009.phpt 518 B

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