fileowner_basic.phpt 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. --TEST--
  2. Test fileowner() function: basic functionality
  3. --FILE--
  4. <?php
  5. echo "*** Testing fileowner(): basic functionality ***\n";
  6. echo "-- Testing with the file or directory created by owner --\n";
  7. var_dump( fileowner(__FILE__) );
  8. var_dump( fileowner(".") );
  9. var_dump( fileowner("./..") );
  10. /* Newly created files and dirs */
  11. $file_path = __DIR__;
  12. $file_name = $file_path."/fileowner_basic.tmp";
  13. $file_handle = fopen($file_name, "w");
  14. $string = "Hello, world\n1234\n123Hello";
  15. fwrite($file_handle, $string);
  16. var_dump( fileowner($file_name) );
  17. fclose($file_handle);
  18. $dir_name = $file_path."/fileowner_basic";
  19. mkdir($dir_name);
  20. var_dump( fileowner($dir_name) );
  21. echo "*** Done ***\n";
  22. ?>
  23. --CLEAN--
  24. <?php
  25. $file_path = __DIR__;
  26. $file_name = $file_path."/fileowner_basic.tmp";
  27. $dir_name = $file_path."/fileowner_basic";
  28. unlink($file_name);
  29. rmdir($dir_name);
  30. ?>
  31. --EXPECTF--
  32. *** Testing fileowner(): basic functionality ***
  33. -- Testing with the file or directory created by owner --
  34. int(%d)
  35. int(%d)
  36. int(%d)
  37. int(%d)
  38. int(%d)
  39. *** Done ***