Annotation of embedaddon/php/ext/standard/tests/file/symlink_to_symlink.phpt, revision 1.1.1.1

1.1       misho       1: --TEST--
                      2: symlink() using a relative path, and symlink() to a symlink
                      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: $prefix = __FILE__;
                     12: 
                     13: touch($prefix . "_file");
                     14: 
                     15: // symlink to a regular file using a relative dest
                     16: symlink(basename($prefix . "_file"), $prefix . "_link1");
                     17: 
                     18: // symlink to a symlink using a relative path
                     19: symlink(basename($prefix . "_link1"), $prefix . "_link2");
                     20: 
                     21: // symlink to a non-existent path
                     22: @unlink($prefix . "_nonexistant");
                     23: symlink(basename($prefix . "_nonexistant"), $prefix . "_link3");
                     24: 
                     25: // symlink to a regular file using an absolute path
                     26: symlink($prefix . "_file", $prefix . "_link4");
                     27: 
                     28: // symlink to a symlink using an absolute path
                     29: symlink($prefix . "_link4", $prefix . "_link5");
                     30: 
                     31: var_dump(readlink($prefix . "_link1"));
                     32: var_dump(readlink($prefix . "_link2"));
                     33: var_dump(readlink($prefix . "_link3"));
                     34: var_dump(readlink($prefix . "_link4"));
                     35: var_dump(readlink($prefix . "_link5"));
                     36: 
                     37: unlink($prefix . "_link5");
                     38: unlink($prefix . "_link4");
                     39: unlink($prefix . "_link3");
                     40: unlink($prefix . "_link2");
                     41: unlink($prefix . "_link1");
                     42: unlink($prefix . "_file");
                     43: 
                     44: ?>
                     45: --EXPECTF--
                     46: %unicode|string%(%d) "symlink_to_symlink.php_file"
                     47: %unicode|string%(%d) "symlink_to_symlink.php_link1"
                     48: %unicode|string%(%d) "symlink_to_symlink.php_nonexistant"
                     49: %unicode|string%(%d) "%s/symlink_to_symlink.php_file"
                     50: %unicode|string%(%d) "%s/symlink_to_symlink.php_link4"

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>