Annotation of embedaddon/php/ext/standard/tests/file/filegroup_basic.phpt, revision 1.1.1.1

1.1       misho       1: --TEST--
                      2: Test filegroup() function: basic functionality
                      3: --SKIPIF--
                      4: <?php
                      5: if( substr(PHP_OS, 0, 3) == 'WIN') {
                      6:   die('skip Not valid for Windows');
                      7: }
                      8: ?>
                      9: --FILE--
                     10: <?php
                     11: /* Prototype: int filegroup ( string $filename )
                     12:  * Description: Returns the group ID of the file, or FALSE in case of an error.
                     13:  */
                     14: 
                     15: echo "*** Testing filegroup(): basic functionality ***\n"; 
                     16: 
                     17: echo "-- Testing with the file or directory created by owner --\n";
                     18: 
                     19: $file_path = dirname(__FILE__);
                     20: var_dump( filegroup(__FILE__) );
                     21: var_dump( filegroup(".") );
                     22: var_dump( filegroup("./..") );
                     23: 
                     24: /* Newly created files and dirs */
                     25: $file_name = $file_path."/filegroup_basic.tmp";
                     26: $file_handle = fopen($file_name, "w");
                     27: 
                     28: $string = "Hello, world\n1234\n123Hello";
                     29: fwrite($file_handle, $string);
                     30: var_dump( filegroup($file_name) );
                     31: fclose($file_handle);
                     32: 
                     33: $dir_name = $file_path."/filegroup_basic";
                     34: mkdir($dir_name);
                     35: var_dump( filegroup($dir_name) );
                     36: 
                     37: echo "\n-- Testing with the standard file or directory --\n";
                     38: var_dump( filegroup("/etc/passwd") );
                     39: var_dump( filegroup("/etc") );
                     40: var_dump( filegroup("/") );
                     41: 
                     42: echo "\n*** Done ***\n";
                     43: ?>
                     44: 
                     45: --CLEAN--
                     46: <?php
                     47: 
                     48: $file_path = dirname(__FILE__);
                     49: $file_name = $file_path."/filegroup_basic.tmp";
                     50: $dir_name  = $file_path."/filegroup_basic";
                     51: unlink($file_name);
                     52: rmdir($dir_name);
                     53: ?>
                     54: 
                     55: --EXPECTF--
                     56: *** Testing filegroup(): basic functionality ***
                     57: -- Testing with the file or directory created by owner --
                     58: int(%d)
                     59: int(%d)
                     60: int(%d)
                     61: int(%d)
                     62: int(%d)
                     63: 
                     64: -- Testing with the standard file or directory --
                     65: int(%d)
                     66: int(%d)
                     67: int(%d)
                     68: 
                     69: *** Done ***

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>