1--TEST--
2bug #44859 (incorrect result with NTFS ACL permissions, is_readable)
3--CREDITS--
4Venkat Raman Don
5--SKIPIF--
6<?php
7include_once __DIR__ . '/common.inc';
8skipif();
9?>
10--FILE--
11<?php
12include_once __DIR__ . '/common.inc';
13fix_acls();
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
22echo "Testing file with relative path:\n";
23$i = 1;
24$path = './a.txt';
25foreach ($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
38echo "Testing directory with relative path:\n";
39$path = 'adir';
40$i = 1;
41foreach ($iteration as $perms => $exp) {
42	create_dir($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_dir($path);
52}
53
54?>
55--EXPECT--
56Testing file with relative path:
57Iteration #1: passed.
58Iteration #2: passed.
59Iteration #3: passed.
60Iteration #4: passed.
61Testing directory with relative path:
62Iteration #1: passed.
63Iteration #2: passed.
64Iteration #3: passed.
65Iteration #4: passed.
66