summaryrefslogtreecommitdiff
path: root/ext/standard/tests/file/disk_free_space_basic.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'ext/standard/tests/file/disk_free_space_basic.phpt')
-rw-r--r--ext/standard/tests/file/disk_free_space_basic.phpt29
1 files changed, 17 insertions, 12 deletions
diff --git a/ext/standard/tests/file/disk_free_space_basic.phpt b/ext/standard/tests/file/disk_free_space_basic.phpt
index d9412198a0..f8684e92a9 100644
--- a/ext/standard/tests/file/disk_free_space_basic.phpt
+++ b/ext/standard/tests/file/disk_free_space_basic.phpt
@@ -7,26 +7,27 @@ memory_limit=32M
/*
* Prototype: float disk_free_space( string directory )
* Description: Given a string containing a directory, this function
- * will return the number of bytes available on the corresponding
- * filesystem or disk partition
+ * will return the number of bytes available on the corresponding
+ * filesystem or disk partition
*/
$file_path = dirname(__FILE__);
-include($file_path."/file.inc");
echo "*** Testing with existing directory ***\n";
var_dump( disk_free_space($file_path) );
var_dump( diskfreespace($file_path) );
-$dir = "/disk_free_space";
echo "*** Testing with newly created directory ***\n";
+$dir = "/disk_free_space";
mkdir($file_path.$dir);
echo" \n Free Space before writing to a file\n";
$space1 = disk_free_space($file_path.$dir);
-var_dump($space1);
+var_dump( $space1 );
-fill_buffer($buffer, "text", 3000000);
-file_put_contents($file_path.$dir."/disk_free_space.tmp", $buffer);
+$fh = fopen($file_path.$dir."/disk_free_space.tmp", "a");
+for( $i=1; $i<=1000; $i++)
+fwrite($fh, (binary)"x");
+fclose($fh);
echo "\n Free Space after writing to a file\n";
$space2 = disk_free_space($file_path.$dir);
@@ -37,15 +38,17 @@ if( $space1 > $space2 )
else
echo "\n Free Space Value Is Incorrect\n";
-echo"\n-- Done --";
+echo "*** Testing with Binary Input ***\n";
+var_dump( disk_free_space(b"$file_path") );
+
+echo"\n--- Done ---";
?>
--CLEAN--
<?php
$file_path = dirname(__FILE__);
-$dir = "/disk_free_space";
-unlink($file_path.$dir."/disk_free_space.tmp");
-rmdir($file_path.$dir);
+unlink($file_path."/disk_free_space/disk_free_space.tmp");
+rmdir($file_path."/disk_free_space");
?>
--EXPECTF--
@@ -61,5 +64,7 @@ float(%d)
float(%d)
Free Space Value Is Correct
+*** Testing with Binary Input ***
+float(%d)
--- Done --
+--- Done ---