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