realpath_basic4.phpt 776 B

1234567891011121314151617181920212223
  1. --TEST--
  2. Test realpath() with relative paths
  3. --FILE--
  4. <?php
  5. $file_path = __DIR__;
  6. @mkdir("$file_path/realpath_basic4/home/test", 0777, true);
  7. @symlink("$file_path/realpath_basic4/home", "$file_path/realpath_basic4/link1");
  8. @symlink("$file_path/realpath_basic4/link1", "$file_path/realpath_basic4/link2");
  9. echo "1. " . realpath("$file_path/realpath_basic4/link2") . "\n";
  10. echo "2. " . realpath("$file_path/realpath_basic4/link2/test") . "\n";
  11. ?>
  12. --CLEAN--
  13. <?php
  14. $file_path = __DIR__;
  15. unlink("$file_path/realpath_basic4/link2");
  16. unlink("$file_path/realpath_basic4/link1");
  17. rmdir("$file_path/realpath_basic4/home/test");
  18. rmdir("$file_path/realpath_basic4/home");
  19. rmdir("$file_path/realpath_basic4");
  20. ?>
  21. --EXPECTF--
  22. 1. %s%erealpath_basic4%ehome
  23. 2. %s%erealpath_basic4%ehome%etest