1--TEST--
2Test lstat() and stat() functions: usage variations - effects changing permissions of file
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 with changing permissions of file */
20
21$file_path = dirname(__FILE__);
22require "$file_path/file.inc";
23
24$filename = "$file_path/lstat_stat_variation16.tmp";
25$fp = fopen($filename, "w");  // temp file
26fclose($fp);
27
28// checking stat() on file after changing its permission
29echo "*** Testing lstat() on a file after changing its access permission ***\n";
30$old_stat = stat($filename);
31sleep(2);
32var_dump( chmod($filename, 0777) );
33// clear the stat
34clearstatcache();
35$new_stat = stat($filename);
36// compare self stats
37var_dump( compare_self_stat($old_stat) );
38var_dump( compare_self_stat($new_stat) );
39// compare the stat
40$affected_members = array(10, 'ctime');
41var_dump( compare_stats($old_stat, $new_stat, $affected_members, "!=") );
42
43echo "\n--- Done ---";
44?>
45--CLEAN--
46<?php
47$file_path = dirname(__FILE__);
48unlink("$file_path/lstat_stat_variation16.tmp");
49?>
50--EXPECTF--
51*** Testing lstat() on a file after changing its access permission ***
52bool(true)
53bool(true)
54bool(true)
55bool(true)
56
57--- Done ---
58