filegroup_variation1.phpt 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. --TEST--
  2. Test filegroup() function: usage variations - links
  3. --CREDITS--
  4. Dave Kelsey <d_kelsey@uk.ibm.com>
  5. --SKIPIF--
  6. <?php
  7. if (substr(PHP_OS, 0, 3) == 'WIN') {
  8. die('skip Do not run on Windows');
  9. }
  10. --FILE--
  11. <?php
  12. /* Prototype: int filegroup ( string $filename )
  13. * Description: Returns the group ID of the file, or FALSE in case of an error.
  14. */
  15. /* Creating soft and hard links to a file and applying filegroup() on links */
  16. $file_path = dirname(__FILE__);
  17. fclose( fopen($file_path."/filegroup_variation1.tmp", "w") );
  18. echo "*** Testing filegroup() with links ***\n";
  19. /* With symlink */
  20. symlink($file_path."/filegroup_variation1.tmp", $file_path."/filegroup_variation1_symlink.tmp");
  21. var_dump( filegroup($file_path."/filegroup_variation1_symlink.tmp") ); //expected true
  22. clearstatcache();
  23. /* With hardlink */
  24. link($file_path."/filegroup_variation1.tmp", $file_path."/filegroup_variation1_link.tmp");
  25. var_dump( filegroup($file_path."/filegroup_variation1_link.tmp") ); // expected: true
  26. clearstatcache();
  27. echo "\n*** Done ***";
  28. ?>
  29. --CLEAN--
  30. <?php
  31. $file_path = dirname(__FILE__);
  32. unlink($file_path."/filegroup_variation1_symlink.tmp");
  33. unlink($file_path."/filegroup_variation1_link.tmp");
  34. unlink($file_path."/filegroup_variation1.tmp");
  35. ?>
  36. --EXPECTF--
  37. *** Testing filegroup() with links ***
  38. int(%d)
  39. int(%d)
  40. *** Done ***