1--TEST--
2Test disk_total_space() function : basic functionality
3--FILE--
4<?php
5/*
6 *  Prototype: float disk_total_space( string $directory );
7 *  Description: given a string containing a directory, this function will
8 *               return the total number of bytes on the corresponding filesyatem
9 *               or disk partition.
10 */
11
12$file_path = dirname(__FILE__);
13
14echo "*** Testing with normal directory ***\n";
15var_dump( disk_total_space($file_path) );
16
17echo "*** Testing with newly created directory ***\n";
18$dir = "/disk_total_space";
19
20mkdir($file_path.$dir);
21var_dump( disk_total_space($file_path.$dir) );
22$fh = fopen($file_path.$dir."/disk_total_space.tmp", "w");
23fwrite($fh, (binary)"Garbage Data Garbage Data Garbage Data Garbage Data Garbage Data Garbage Data Garbage Data");
24
25fclose($fh);
26
27echo"\nTotal Space after writing to a file\n";
28var_dump( disk_total_space($file_path.$dir) );
29
30echo"\n-- Done --";
31?>
32--CLEAN--
33<?php
34$file_path = dirname(__FILE__);
35unlink($file_path."/disk_total_space/disk_total_space.tmp");
36rmdir($file_path."/disk_total_space");
37?>
38
39--EXPECTF--
40*** Testing with normal directory ***
41float(%d)
42*** Testing with newly created directory ***
43float(%d)
44
45Total Space after writing to a file
46float(%d)
47
48-- Done --
49