diff options
Diffstat (limited to 'ext/standard/tests/file/ftruncate_error.phpt')
-rw-r--r-- | ext/standard/tests/file/ftruncate_error.phpt | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/ext/standard/tests/file/ftruncate_error.phpt b/ext/standard/tests/file/ftruncate_error.phpt index a28095bc2d..2f22d4e25f 100644 --- a/ext/standard/tests/file/ftruncate_error.phpt +++ b/ext/standard/tests/file/ftruncate_error.phpt @@ -11,7 +11,7 @@ echo "*** Testing ftruncate() : error conditions ***\n"; $filename = dirname(__FILE__)."/ftruncate_error.tmp"; $file_handle = fopen($filename, "w" ); -fwrite($file_handle, (binary)"Testing ftruncate error conditions \n"); +fwrite($file_handle, "Testing ftruncate error conditions \n"); fflush($file_handle); echo "\n Initial file size = ".filesize($filename)."\n"; @@ -23,12 +23,14 @@ var_dump( ftruncate() ); // arguments less than expected numbers var_dump( ftruncate( $file_handle ) ); // check the first size +clearstatcache(); var_dump( filesize($filename) ); echo "-- Testing ftruncate() with more than expected number of arguments --\n"; // more than expected number of arguments var_dump( ftruncate($file_handle, 10, 20) ); -// check the first size +// check the first size +clearstatcache(); var_dump( filesize($filename) ); // test invalid arguments : non-resources @@ -53,14 +55,16 @@ echo "-- Testing ftruncate() with closed/unset file handle --\n"; // ftruncate on close file handle fclose($file_handle); var_dump( ftruncate($file_handle,10) ); -// check the first size +// check the first size +clearstatcache(); var_dump( filesize($filename) ); // ftruncate on a file handle which is unset $fp = fopen($filename, "w"); unset($fp); //unset file handle var_dump( ftruncate(@$fp,10)); -// check the first size +// check the first size +clearstatcache(); var_dump( filesize($filename) ); echo "Done\n"; @@ -114,11 +118,12 @@ Warning: ftruncate() expects parameter 1 to be resource, object given in %s on l bool(false) -- Testing ftruncate() with closed/unset file handle -- -Warning: ftruncate(): 5 is not a valid stream resource in %s on line %d +Warning: ftruncate(): %d is not a valid stream resource in %s on line %d bool(false) int(36) Warning: ftruncate() expects parameter 1 to be resource, null given in %s on line %d bool(false) -int(36) +int(0) Done + |