File:
[ELWIX - Embedded LightWeight unIX -] /
embedaddon /
php /
ext /
standard /
tests /
file /
fstat_variation8.phpt
Revision
1.1.1.1 (vendor branch):
download - view:
text,
annotated -
select for diffs -
revision graph
Tue Feb 21 23:48:03 2012 UTC (12 years, 6 months ago) by
misho
Branches:
php,
MAIN
CVS tags:
v5_4_3elwix,
v5_4_29p0,
v5_4_29,
v5_4_20p0,
v5_4_20,
v5_4_17p0,
v5_4_17,
v5_3_10,
HEAD
php
--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===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>