Annotation of embedaddon/php/ext/standard/tests/file/lchown_basic.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Test lchown() 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_getuid")) die("skip no posix_getuid()");
! 7: ?>
! 8: --FILE--
! 9: <?php
! 10: /* Prototype : bool lchown (string filename, mixed user)
! 11: * Description: Change file owner of a symlink
! 12: * Source code: ext/standard/filestat.c
! 13: * Alias to functions:
! 14: */
! 15:
! 16: echo "*** Testing lchown() : basic functionality ***\n";
! 17: $filename = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'lchown.txt';
! 18: $symlink = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'symlink.txt';
! 19:
! 20: $uid = posix_getuid();
! 21:
! 22: var_dump( touch( $filename ) );
! 23: var_dump( symlink( $filename, $symlink ) );
! 24: var_dump( lchown( $filename, $uid ) );
! 25: var_dump( fileowner( $symlink ) === $uid );
! 26:
! 27: ?>
! 28: ===DONE===
! 29: --CLEAN--
! 30: <?php
! 31:
! 32: $filename = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'lchown.txt';
! 33: $symlink = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'symlink.txt';
! 34: unlink($filename);
! 35: unlink($symlink);
! 36:
! 37: ?>
! 38: --EXPECTF--
! 39: *** Testing lchown() : basic functionality ***
! 40: bool(true)
! 41: bool(true)
! 42: bool(true)
! 43: bool(true)
! 44: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>