rename_variation7-win32.phpt 985 B

123456789101112131415161718192021222324252627282930313233343536
  1. --TEST--
  2. Test rename() function: usage variations-8
  3. --SKIPIF--
  4. <?php
  5. if (substr(PHP_OS, 0, 3) != 'WIN') die('skip.. for Windows');
  6. if (!function_exists("symlink")) die("skip symlinks are not supported");
  7. ?>
  8. --FILE--
  9. <?php
  10. $tmp_link = __FILE__.".tmp.link";
  11. $tmp_link2 = __FILE__.".tmp.link2";
  12. if (symlink(__DIR__."/there_is_no_such_file", $tmp_link)) {
  13. rename($tmp_link, $tmp_link2);
  14. }
  15. clearstatcache();
  16. var_dump(readlink($tmp_link));
  17. var_dump(readlink($tmp_link2));
  18. @unlink($tmp_link);
  19. @unlink($tmp_link2);
  20. echo "Done\n";
  21. ?>
  22. --EXPECTF--
  23. Warning: symlink(): No such file or directory in %srename_variation7-win32.php on line %d
  24. Warning: readlink(): readlink failed to read the symbolic link (%srename_variation7-win32.php.tmp.link), error 2) in %srename_variation7-win32.php on line %d
  25. bool(false)
  26. Warning: readlink(): readlink failed to read the symbolic link (%srename_variation7-win32.php.tmp.link2), error 2) in %srename_variation7-win32.php on line %d
  27. bool(false)
  28. Done