1--TEST--
2bug #44859 (incorrect result with NTFS ACL permissions, is_writable)
3--SKIPIF--
4<?php
5include_once __DIR__ . '/common.inc';
6skipif();
7?>
8--FILE--
9<?php
10include_once __DIR__ . '/common.inc';
11fix_acls();
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
20echo "Testing file:\n";
21$i = 1;
22$path = __DIR__ . '/a.txt';
23foreach ($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
36echo "Testing directory:\n";
37$path = __DIR__ . '/adir';
38$i = 1;
39foreach ($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--
54Testing file:
55Iteration #1: passed.
56Iteration #2: passed.
57Iteration #3: passed.
58Iteration #4: passed.
59Testing directory:
60Iteration #1: passed.
61Iteration #2: passed.
62Iteration #3: passed.
63Iteration #4: passed.
64