Annotation of embedaddon/php/ext/phar/tests/tar/dir.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Phar: mkdir/rmdir test tar-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.tar.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::TAR));
18:
19: $phar->addEmptyDir('test');
20: var_dump(isset($phar['.phar/stub.php']));
21: var_dump($phar['test']->isDir());
22: var_dump($phar['test/']->isDir());
23: copy($fname, $fname2);
24: mkdir($pname . '/another/dir/');
25: var_dump($phar['another/dir']->isDir());
26: rmdir($pname . '/another/dir/');
27: copy($fname, $fname3);
28: clearstatcache();
29: var_dump(file_exists($pname . '/another/dir/'));
30: var_dump(file_exists($pname2 . '/test/'));
31: var_dump(file_exists($pname3 . '/another/dir/'));
32: ?>
33: --CLEAN--
34: <?php unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar.tar.php'); ?>
35: <?php unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.1.phar.php'); ?>
36: <?php unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.2.phar.php'); ?>
37: --EXPECT--
38: bool(true)
39: bool(false)
40: bool(true)
41: bool(true)
42: bool(true)
43: bool(false)
44: bool(true)
45: bool(false)
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>