filegroup_basic.phpt 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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. echo "*** Testing filegroup(): basic functionality ***\n";
  12. echo "-- Testing with the file or directory created by owner --\n";
  13. $file_path = __DIR__;
  14. var_dump( filegroup(__FILE__) );
  15. var_dump( filegroup(".") );
  16. var_dump( filegroup("./..") );
  17. /* Newly created files and dirs */
  18. $file_name = $file_path."/filegroup_basic.tmp";
  19. $file_handle = fopen($file_name, "w");
  20. $string = "Hello, world\n1234\n123Hello";
  21. fwrite($file_handle, $string);
  22. var_dump( filegroup($file_name) );
  23. fclose($file_handle);
  24. $dir_name = $file_path."/filegroup_basic";
  25. mkdir($dir_name);
  26. var_dump( filegroup($dir_name) );
  27. echo "\n-- Testing with the standard file or directory --\n";
  28. var_dump( filegroup("/etc/passwd") );
  29. var_dump( filegroup("/etc") );
  30. var_dump( filegroup("/") );
  31. echo "\n*** Done ***\n";
  32. ?>
  33. --CLEAN--
  34. <?php
  35. $file_path = __DIR__;
  36. $file_name = $file_path."/filegroup_basic.tmp";
  37. $dir_name = $file_path."/filegroup_basic";
  38. unlink($file_name);
  39. rmdir($dir_name);
  40. ?>
  41. --EXPECTF--
  42. *** Testing filegroup(): basic functionality ***
  43. -- Testing with the file or directory created by owner --
  44. int(%d)
  45. int(%d)
  46. int(%d)
  47. int(%d)
  48. int(%d)
  49. -- Testing with the standard file or directory --
  50. int(%d)
  51. int(%d)
  52. int(%d)
  53. *** Done ***