mirror of
https://github.com/php/php-src.git
synced 2026-04-30 03:33:17 +02:00
Revert to the previous version for these tests as they were overwritten by mistake (checked on Windows but not on Linux... so the six skipped tests may not work correctly... but they should be ok and I'll watch the test results).
This commit is contained in:
@@ -23,14 +23,12 @@ 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
|
||||
clearstatcache();
|
||||
// check the first size
|
||||
var_dump( filesize($filename) );
|
||||
|
||||
// test invalid arguments : non-resources
|
||||
@@ -55,16 +53,14 @@ 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
|
||||
clearstatcache();
|
||||
// check the first size
|
||||
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
|
||||
clearstatcache();
|
||||
// check the first size
|
||||
var_dump( filesize($filename) );
|
||||
|
||||
echo "Done\n";
|
||||
@@ -124,5 +120,5 @@ int(36)
|
||||
|
||||
Warning: ftruncate(): supplied argument is not a valid stream resource in %s on line %d
|
||||
bool(false)
|
||||
int(0)
|
||||
int(36)
|
||||
Done
|
||||
|
||||
Reference in New Issue
Block a user