diff options
Diffstat (limited to 'ext/standard/tests/file/fstat_variation8.phpt')
-rw-r--r-- | ext/standard/tests/file/fstat_variation8.phpt | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/ext/standard/tests/file/fstat_variation8.phpt b/ext/standard/tests/file/fstat_variation8.phpt new file mode 100644 index 0000000..b493d4e --- /dev/null +++ b/ext/standard/tests/file/fstat_variation8.phpt @@ -0,0 +1,33 @@ +--TEST-- +Test function fstat() by calling it with its expected arguments +--FILE-- +<?php +$stat_result = stat(__FILE__); +clearstatcache(); +$fp = fopen (__FILE__, 'r'); +$fstat_result = fstat($fp); +fclose($fp); + +$isWin = (substr(PHP_OS, 0, 3) == 'WIN'); +$failed = false; +foreach($stat_result as $key =>$value) { + if ($isWin && ($key === 0 || $key === 6 || $key === 'dev' || $key === 'rdev')) { + // windows, dev and rdev will not match this is expected + } + else { + if ($fstat_result[$key] != $value) { + echo "FAIL: stat differs at '$key'. $fstat_result[$key] -- $value\n"; + $failed = true; + } + } +} +if ($failed !== true) { + echo "PASSED: all elements are the same\n"; +} + + +?> +===DONE=== +--EXPECT-- +PASSED: all elements are the same +===DONE===
\ No newline at end of file |