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/* Prototype: array lstat ( string $filename );
13   Description: Gives information about a file or symbolic link
14
15   Prototype: array stat ( string $filename );
16   Description: Gives information about a file
17*/
18
19/* test the effects on stats by changing permissions of a dir */
20
21$file_path = dirname(__FILE__);
22require "$file_path/file.inc";
23
24// checking stat() on directory
25echo "*** Testing lstat() on a dir after changing its access permission ***\n";
26$dirname = "$file_path/lstat_stat_variation17";
27mkdir($dirname);
28
29$old_stat = stat($dirname);
30sleep(2);
31var_dump( chmod($dirname, 0777) );
32// clear the stat
33clearstatcache();
34$new_stat = stat($dirname);
35// compare self stats
36var_dump( compare_self_stat($old_stat) );
37var_dump( compare_self_stat($new_stat) );
38// compare the stat
39$affected_members = array(2, 10, 'mode', 'ctime');
40var_dump( compare_stats($old_stat, $new_stat, $affected_members, "!=") );
41
42echo "\n--- Done ---";
43?>
44--CLEAN--
45<?php
46$file_path = dirname(__FILE__);
47rmdir("$file_path/lstat_stat_variation17");
48?>
49--EXPECT--
50*** Testing lstat() on a dir after changing its access permission ***
51bool(true)
52bool(true)
53bool(true)
54bool(true)
55
56--- Done ---
57