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