Annotation of embedaddon/php/ext/phar/tests/033.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Phar::chmod
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') . '.1.phar.php';
11: $pname = 'phar://hio';
12: $file = '<?php include "' . $pname . '/a.php"; __HALT_COMPILER(); ?>';
13:
14: $files = array();
15: $files['a.php'] = '<?php echo "This is a\n"; include "'.$pname.'/b.php"; ?>';
16: $files['dir/'] = '';
17: $hasdir = 1;
18: include 'files/phar_test.inc';
19: $a = new Phar($fname);
20: var_dump($a['a.php']->isExecutable());
21: $a['a.php']->chmod(0777);
22: var_dump($a['a.php']->isExecutable());
23: $a['a.php']->chmod(0666);
24: var_dump($a['a.php']->isExecutable());
25: echo "test dir\n";
26: var_dump($a['dir']->isDir());
27: var_dump($a['dir']->isReadable());
28: $a['dir']->chmod(000);
29: var_dump($a['dir']->isReadable());
30: $a['dir']->chmod(0666);
31: var_dump($a['dir']->isReadable());
32: ?>
33: ===DONE===
34: --CLEAN--
35: <?php
36: unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.1.phar.php');
37: ?>
38: --EXPECT--
39: bool(false)
40: bool(true)
41: bool(false)
42: test dir
43: bool(true)
44: bool(true)
45: bool(false)
46: bool(true)
47: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>