Annotation of embedaddon/php/ext/zip/tests/oo_addemptydir.phpt, revision 1.1.1.2
1.1 misho 1: --TEST--
2: ziparchive::addEmptyDir
3: --SKIPIF--
4: <?php
1.1.1.2 ! misho 5: /* $Id$ */
1.1 misho 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:
22: $zip->addEmptyDir('emptydir');
23: if ($zip->status == ZIPARCHIVE::ER_OK) {
24: dump_entries_name($zip);
25: $zip->close();
26: } else {
27: echo "failed\n";
28: }
29: @unlink($file);
30: ?>
31: --EXPECTF--
32: 0 bar
33: 1 foobar/
34: 2 foobar/baz
35: 3 entry1.txt
36: 4 emptydir/
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>