Annotation of embedaddon/php/ext/standard/tests/file/windows_acls/bug44859.phpt, revision 1.1.1.2
1.1 misho 1: --TEST--
2: bug #44859 (incorrect result with NTFS ACL permissions, is_writable)
3: --SKIPIF--
4: <?php
5: include_once __DIR__ . '/common.inc';
6: skipif();
7: ?>
8: --FILE--
9: <?php
10: include_once __DIR__ . '/common.inc';
1.1.1.2 ! misho 11: fix_acls();
1.1 misho 12:
13: $iteration = array(
14: PHPT_ACL_READ => false,
15: PHPT_ACL_NONE => false,
16: PHPT_ACL_WRITE => true,
17: PHPT_ACL_WRITE|PHPT_ACL_READ => true,
18: );
19:
20: echo "Testing file:\n";
21: $i = 1;
22: $path = __DIR__ . '/a.txt';
23: foreach ($iteration as $perms => $exp) {
24: create_file($path, $perms);
25: clearstatcache(true, $path);
26: echo 'Iteration #' . $i++ . ': ';
27: if (is_writable($path) == $exp) {
28: echo "passed.\n";
29: } else {
30: var_dump(is_writable($path), $exp);
31: echo "failed.\n";
32: }
33: delete_file($path);
34: }
35:
36: echo "Testing directory:\n";
37: $path = __DIR__ . '/adir';
38: $i = 1;
39: foreach ($iteration as $perms => $exp) {
40: create_file($path, $perms);
41: clearstatcache(true, $path);
42: echo 'Iteration #' . $i++ . ': ';
43: if (is_writable($path) == $exp) {
44: echo "passed.\n";
45: } else {
46: var_dump(is_writable($path), $exp);
47: echo "failed.\n";
48: }
49: delete_file($path);
50: }
51:
52: ?>
53: --EXPECT--
54: Testing file:
55: Iteration #1: passed.
56: Iteration #2: passed.
57: Iteration #3: passed.
58: Iteration #4: passed.
59: Testing directory:
60: Iteration #1: passed.
61: Iteration #2: passed.
62: Iteration #3: passed.
63: Iteration #4: passed.
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>