1--TEST--
2Test lstat() and stat() functions: usage variations - effects changing permissions of dir
3--SKIPIF--
4<?php
5if (getenv("SKIP_SLOW_TESTS")) die("skip slow test");
6if (substr(PHP_OS, 0, 3) == 'WIN') {
7    die('skip.. Not valid for Windows');
8}
9?>
10--FILE--
11<?php
12/* test the effects on stats by changing permissions of a dir */
13
14$file_path = __DIR__;
15require "$file_path/file.inc";
16
17// checking stat() on directory
18echo "*** Testing lstat() on a dir after changing its access permission ***\n";
19$dirname = "$file_path/lstat_stat_variation17";
20mkdir($dirname);
21
22$old_stat = stat($dirname);
23sleep(1);
24var_dump( chmod($dirname, 0777) );
25// clear the stat
26clearstatcache();
27$new_stat = stat($dirname);
28// compare self stats
29var_dump( compare_self_stat($old_stat) );
30var_dump( compare_self_stat($new_stat) );
31// compare the stat
32$affected_members = array(2, 10, 'mode', 'ctime');
33var_dump( compare_stats($old_stat, $new_stat, $affected_members, "!=") );
34
35echo "\n--- Done ---";
36?>
37--CLEAN--
38<?php
39$file_path = __DIR__;
40rmdir("$file_path/lstat_stat_variation17");
41?>
42--EXPECT--
43*** Testing lstat() on a dir after changing its access permission ***
44bool(true)
45bool(true)
46bool(true)
47bool(true)
48
49--- Done ---
50