1--TEST--
2Test lchown() function : basic functionality
3--SKIPIF--
4<?php
5if (substr(PHP_OS, 0, 3) == 'WIN') die('skip no windows support');
6if (!function_exists("posix_getuid")) die("skip no posix_getuid()");
7?>
8--FILE--
9<?php
10echo "*** Testing lchown() : basic functionality ***\n";
11$filename = __DIR__ . DIRECTORY_SEPARATOR . 'lchown_basic.txt';
12$symlink = __DIR__ . DIRECTORY_SEPARATOR . 'lchown_basic_symlink.txt';
13
14$uid = posix_getuid();
15
16var_dump( touch( $filename ) );
17var_dump( symlink( $filename, $symlink ) );
18var_dump( lchown( $filename, $uid ) );
19var_dump( fileowner( $symlink ) === $uid );
20
21?>
22--CLEAN--
23<?php
24
25$filename = __DIR__ . DIRECTORY_SEPARATOR . 'lchown_basic.txt';
26$symlink = __DIR__ . DIRECTORY_SEPARATOR . 'lchown_basic_symlink.txt';
27unlink($filename);
28unlink($symlink);
29
30?>
31--EXPECT--
32*** Testing lchown() : basic functionality ***
33bool(true)
34bool(true)
35bool(true)
36bool(true)
37