rename_variation6-win32.phpt 766 B

12345678910111213141516171819202122232425262728293031323334353637
  1. --TEST--
  2. Test rename() function: usage variations-6
  3. --SKIPIF--
  4. <?php
  5. if (substr(PHP_OS, 0, 3) != 'WIN') die('skip.. for Windows');
  6. include_once __DIR__ . '/windows_links/common.inc';
  7. skipIfSeCreateSymbolicLinkPrivilegeIsDisabled(__FILE__);
  8. ?>
  9. --FILE--
  10. <?php
  11. $tmp_file = __FILE__.".tmp";
  12. $tmp_link = __FILE__.".tmp.link";
  13. $tmp_link2 = __FILE__.".tmp.link2";
  14. touch($tmp_file);
  15. symlink($tmp_file, $tmp_link);
  16. rename($tmp_link, $tmp_link2);
  17. clearstatcache();
  18. var_dump(readlink($tmp_link));
  19. var_dump(readlink($tmp_link2));
  20. var_dump(file_exists($tmp_file));
  21. @unlink($tmp_link);
  22. @unlink($tmp_link2);
  23. @unlink($tmp_file);
  24. echo "Done\n";
  25. ?>
  26. --EXPECTF--
  27. Warning: readlink(): %s in %s on line %d
  28. bool(false)
  29. string(%d) "%srename_variation6-win32.php.tmp"
  30. bool(true)
  31. Done