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