Annotation of embedaddon/php/ext/phar/tests/zip/dir.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Phar: mkdir/rmdir test zip-based
3: --SKIPIF--
4: <?php if (!extension_loaded("phar")) die("skip"); ?>
5: --INI--
6: phar.readonly=0
7: phar.require_hash=0
8: --FILE--
9: <?php
10: $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.zip.php';
11: $pname = 'phar://' . $fname;
12: $fname2 = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.1.phar.php';
13: $pname2 = 'phar://' . $fname2;
14: $fname3 = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.2.phar.php';
15: $pname3 = 'phar://' . $fname3;
16: $phar = new Phar($fname);
17: var_dump($phar->isFileFormat(Phar::ZIP));
18:
19: $phar->addEmptyDir('test');
20: var_dump($phar['test']->isDir());
21: var_dump($phar['test/']->isDir());
22: copy($fname, $fname2);
23: mkdir($pname . '/another/dir/');
24: var_dump($phar['another/dir']->isDir());
25: rmdir($pname . '/another/dir/');
26: copy($fname, $fname3);
27: clearstatcache();
28: var_dump(file_exists($pname . '/another/dir/'));
29: var_dump(file_exists($pname2 . '/test/'));
30: var_dump(file_exists($pname3 . '/another/dir/'));
31: ?>
32: --CLEAN--
33: <?php unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar.zip.php'); ?>
34: <?php unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.1.phar.php'); ?>
35: <?php unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.2.phar.php'); ?>
36: --EXPECT--
37: bool(true)
38: bool(true)
39: bool(true)
40: bool(true)
41: bool(false)
42: bool(true)
43: bool(false)
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>