summaryrefslogtreecommitdiff
path: root/ext/standard/tests/file/lchgrp_basic.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'ext/standard/tests/file/lchgrp_basic.phpt')
-rw-r--r--ext/standard/tests/file/lchgrp_basic.phpt36
1 files changed, 36 insertions, 0 deletions
diff --git a/ext/standard/tests/file/lchgrp_basic.phpt b/ext/standard/tests/file/lchgrp_basic.phpt
new file mode 100644
index 0000000..1713bef
--- /dev/null
+++ b/ext/standard/tests/file/lchgrp_basic.phpt
@@ -0,0 +1,36 @@
+--TEST--
+Test lchgrp() function : basic functionality
+--SKIPIF--
+<?php
+if (substr(PHP_OS, 0, 3) == 'WIN') die('skip no windows support');
+if (!function_exists("posix_getgid")) die("skip no posix_getgid()");
+?>
+--FILE--
+<?php
+$filename = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'lchgrp.txt';
+$symlink = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'symlink.txt';
+
+$gid = posix_getgid();
+
+var_dump( touch( $filename ) );
+var_dump( symlink( $filename, $symlink ) );
+var_dump( lchgrp( $filename, $gid ) );
+var_dump( filegroup( $symlink ) === $gid );
+
+?>
+===DONE===
+--CLEAN--
+<?php
+
+$filename = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'lchgrp.txt';
+$symlink = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'symlink.txt';
+unlink($filename);
+unlink($symlink);
+
+?>
+--EXPECTF--
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+===DONE===