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

1.1       misho       1: --TEST--
                      2: Test rename() function: usage variations-6
                      3: --SKIPIF--
                      4: <?php
                      5: if (substr(PHP_OS, 0, 3) == 'WIN') die('skip.. not for Windows');
                      6: if (!function_exists("symlink")) die("skip symlinks are not supported");
                      7: ?>
                      8: --FILE--
                      9: <?php
                     10: 
                     11: $tmp_file = __FILE__.".tmp";
                     12: $tmp_link = __FILE__.".tmp.link";
                     13: $tmp_link2 = __FILE__.".tmp.link2";
                     14: 
                     15: touch($tmp_file);
                     16: symlink($tmp_file, $tmp_link);
                     17: rename($tmp_link, $tmp_link2);
                     18: 
                     19: clearstatcache();
                     20: 
                     21: var_dump(readlink($tmp_link));
                     22: var_dump(readlink($tmp_link2));
                     23: var_dump(file_exists($tmp_file));
                     24: 
                     25: @unlink($tmp_link);
                     26: @unlink($tmp_link2);
                     27: @unlink($tmp_file);
                     28: 
                     29: echo "Done\n";
                     30: ?>
                     31: --EXPECTF--    
                     32: Warning: readlink(): No such file or directory in %s on line %d
                     33: bool(false)
                     34: string(%d) "%srename_variation6.php.tmp"
                     35: bool(true)
                     36: Done

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