Annotation of embedaddon/php/ext/zip/tests/oo_addfile.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: ziparchive::addFile() function
! 3: --SKIPIF--
! 4: <?php
! 5: /* $Id: oo_addfile.phpt 260091 2008-05-21 09:27:41Z pajoye $ */
! 6: if(!extension_loaded('zip')) die('skip');
! 7: ?>
! 8: --FILE--
! 9: <?php
! 10:
! 11: $dirname = dirname(__FILE__) . '/';
! 12: include $dirname . 'utils.inc';
! 13: $file = $dirname . '__tmp_oo_addfile.zip';
! 14:
! 15: copy($dirname . 'test.zip', $file);
! 16:
! 17: $zip = new ZipArchive;
! 18: if (!$zip->open($file)) {
! 19: exit('failed');
! 20: }
! 21: if (!$zip->addFile($dirname . 'utils.inc', 'test.php')) {
! 22: echo "failed\n";
! 23: }
! 24: if ($zip->status == ZIPARCHIVE::ER_OK) {
! 25: dump_entries_name($zip);
! 26: $zip->close();
! 27: } else {
! 28: echo "failed\n";
! 29: }
! 30: @unlink($file);
! 31: ?>
! 32: --EXPECTF--
! 33: 0 bar
! 34: 1 foobar/
! 35: 2 foobar/baz
! 36: 3 entry1.txt
! 37: 4 test.php
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>