lchgrp_basic.phpt 758 B

12345678910111213141516171819202122232425262728293031323334
  1. --TEST--
  2. Test lchgrp() function : basic functionality
  3. --SKIPIF--
  4. <?php
  5. if (substr(PHP_OS, 0, 3) == 'WIN') die('skip no windows support');
  6. if (!function_exists("posix_getgid")) die("skip no posix_getgid()");
  7. ?>
  8. --FILE--
  9. <?php
  10. $filename = __DIR__ . DIRECTORY_SEPARATOR . 'lchgrp.txt';
  11. $symlink = __DIR__ . DIRECTORY_SEPARATOR . 'symlink.txt';
  12. $gid = posix_getgid();
  13. var_dump( touch( $filename ) );
  14. var_dump( symlink( $filename, $symlink ) );
  15. var_dump( lchgrp( $filename, $gid ) );
  16. var_dump( filegroup( $symlink ) === $gid );
  17. ?>
  18. --CLEAN--
  19. <?php
  20. $filename = __DIR__ . DIRECTORY_SEPARATOR . 'lchgrp.txt';
  21. $symlink = __DIR__ . DIRECTORY_SEPARATOR . 'symlink.txt';
  22. unlink($filename);
  23. unlink($symlink);
  24. ?>
  25. --EXPECT--
  26. bool(true)
  27. bool(true)
  28. bool(true)
  29. bool(true)