Return to fstat_variation8.phpt CVS log | Up to [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / ext / standard / tests / file |
1.1 misho 1: --TEST-- 2: Test function fstat() by calling it with its expected arguments 3: --FILE-- 4: <?php 5: $stat_result = stat(__FILE__); 6: clearstatcache(); 7: $fp = fopen (__FILE__, 'r'); 8: $fstat_result = fstat($fp); 9: fclose($fp); 10: 11: $isWin = (substr(PHP_OS, 0, 3) == 'WIN'); 12: $failed = false; 13: foreach($stat_result as $key =>$value) { 14: if ($isWin && ($key === 0 || $key === 6 || $key === 'dev' || $key === 'rdev')) { 15: // windows, dev and rdev will not match this is expected 16: } 17: else { 18: if ($fstat_result[$key] != $value) { 19: echo "FAIL: stat differs at '$key'. $fstat_result[$key] -- $value\n"; 20: $failed = true; 21: } 22: } 23: } 24: if ($failed !== true) { 25: echo "PASSED: all elements are the same\n"; 26: } 27: 28: 29: ?> 30: ===DONE=== 31: --EXPECT-- 32: PASSED: all elements are the same 33: ===DONE===