Annotation of embedaddon/php/ext/standard/tests/file/symlink.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: symlink() & friends
! 3: --SKIPIF--
! 4: <?php
! 5: if (substr(PHP_OS, 0, 3) == 'WIN') {
! 6: die('skip no symlinks on Windows');
! 7: }
! 8: ?>
! 9: --FILE--
! 10: <?php
! 11:
! 12: $filename = dirname(__FILE__)."/symlink.dat";
! 13: $link = dirname(__FILE__)."/symlink.link";
! 14:
! 15: var_dump(symlink($filename, $link));
! 16: var_dump(readlink($link));
! 17: var_dump(linkinfo($link));
! 18: @unlink($link);
! 19:
! 20: var_dump(readlink($link));
! 21: var_dump(linkinfo($link));
! 22:
! 23: touch($filename);
! 24: var_dump(symlink($filename, dirname(__FILE__)));
! 25: @unlink($link);
! 26:
! 27: var_dump(symlink($filename, $link));
! 28: @unlink($link);
! 29:
! 30: touch($link);
! 31: var_dump(symlink($filename, $link));
! 32: @unlink($link);
! 33:
! 34: var_dump(link($filename, $link));
! 35: @unlink($filename);
! 36:
! 37: var_dump(link($filename, $link));
! 38: @unlink($link);
! 39:
! 40: var_dump(symlink(".", "."));
! 41: var_dump(link(".", "."));
! 42: var_dump(readlink("."));
! 43: var_dump(linkinfo("."));
! 44:
! 45: echo "Done\n";
! 46: ?>
! 47: --EXPECTF--
! 48: bool(true)
! 49: string(%d) "%ssymlink.dat"
! 50: int(%d)
! 51:
! 52: Warning: readlink(): No such file or directory in %s on line %d
! 53: bool(false)
! 54:
! 55: Warning: linkinfo(): No such file or directory in %s on line %d
! 56: int(-1)
! 57:
! 58: Warning: symlink(): File exists in %s on line %d
! 59: bool(false)
! 60: bool(true)
! 61:
! 62: Warning: symlink(): File exists in %s on line %d
! 63: bool(false)
! 64: bool(true)
! 65:
! 66: Warning: link(): No such file or directory in %s on line %d
! 67: bool(false)
! 68:
! 69: Warning: symlink(): %s in %s on line %d
! 70: bool(false)
! 71:
! 72: Warning: link(): %s in %s on line %d
! 73: bool(false)
! 74:
! 75: Warning: readlink(): Invalid argument in %s on line %d
! 76: bool(false)
! 77: int(%d)
! 78: Done
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>