import zend standard tests
[hiphop-php.git] / hphp / test / zend / good / ext-standard-file / filegroup_basic.php
blob5b66cbe1279f5b4fb1a76ff9c8a786117f0bccc3
1 <?php
2 /* Prototype: int filegroup ( string $filename )
3 * Description: Returns the group ID of the file, or FALSE in case of an error.
4 */
6 echo "*** Testing filegroup(): basic functionality ***\n";
8 echo "-- Testing with the file or directory created by owner --\n";
10 $file_path = dirname(__FILE__);
11 var_dump( filegroup(__FILE__) );
12 var_dump( filegroup(".") );
13 var_dump( filegroup("./..") );
15 /* Newly created files and dirs */
16 $file_name = $file_path."/filegroup_basic.tmp";
17 $file_handle = fopen($file_name, "w");
19 $string = "Hello, world\n1234\n123Hello";
20 fwrite($file_handle, $string);
21 var_dump( filegroup($file_name) );
22 fclose($file_handle);
24 $dir_name = $file_path."/filegroup_basic";
25 mkdir($dir_name);
26 var_dump( filegroup($dir_name) );
28 echo "\n-- Testing with the standard file or directory --\n";
29 var_dump( filegroup("/etc/passwd") );
30 var_dump( filegroup("/etc") );
31 var_dump( filegroup("/") );
33 echo "\n*** Done ***\n";
35 <?php
37 $file_path = dirname(__FILE__);
38 $file_name = $file_path."/filegroup_basic.tmp";
39 $dir_name = $file_path."/filegroup_basic";
40 unlink($file_name);
41 rmdir($dir_name);