Return to lstat_stat_variation17.phpt CVS log | Up to [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / ext / standard / tests / file |
1.1 misho 1: --TEST-- 2: Test lstat() and stat() functions: usage variations - effects changing permissions of dir 3: --SKIPIF-- 4: <?php 5: if (getenv("SKIP_SLOW_TESTS")) die("skip slow test"); 6: if (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__); 22: require "$file_path/file.inc"; 23: 24: // checking stat() on directory 25: echo "*** Testing lstat() on a dir after changing its access permission ***\n"; 26: $dirname = "$file_path/lstat_stat_variation17"; 27: mkdir($dirname); 28: 29: $old_stat = stat($dirname); 30: sleep(2); 31: var_dump( chmod($dirname, 0777) ); 32: // clear the stat 33: clearstatcache(); 34: $new_stat = stat($dirname); 35: // compare self stats 36: var_dump( compare_self_stat($old_stat) ); 37: var_dump( compare_self_stat($new_stat) ); 38: // compare the stat 39: $affected_members = array(2, 10, 'mode', 'ctime'); 40: var_dump( compare_stats($old_stat, $new_stat, $affected_members, "!=") ); 41: 42: echo "\n--- Done ---"; 43: ?> 44: 45: --CLEAN-- 46: <?php 47: $file_path = dirname(__FILE__); 48: rmdir("$file_path/lstat_stat_variation17"); 49: ?> 50: --EXPECTF-- 51: *** Testing lstat() on a dir after changing its access permission *** 52: bool(true) 53: bool(true) 54: bool(true) 55: bool(true) 56: 57: --- Done ---