Return to lchown_basic.phpt CVS log | Up to [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / ext / standard / tests / file |
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"; 1.1.1.2 ! misho 17: $filename = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'lchown_basic.txt'; ! 18: $symlink = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'lchown_basic_symlink.txt'; 1.1 misho 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: 1.1.1.2 ! misho 32: $filename = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'lchown_basic.txt'; ! 33: $symlink = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'lchown_basic_symlink.txt'; 1.1 misho 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===