open_basedir_copy_variation1.phpt 736 B

123456789101112131415161718192021222324252627282930313233
  1. --TEST--
  2. Test open_basedir configuration
  3. --INI--
  4. open_basedir=.
  5. --FILE--
  6. <?php
  7. require_once "open_basedir.inc";
  8. test_open_basedir_before("copy");
  9. var_dump(copy("../bad/bad.txt", "copy.txt"));
  10. var_dump(unlink("copy.txt"));
  11. test_open_basedir_after("copy");
  12. ?>
  13. --CLEAN--
  14. <?php
  15. require_once "open_basedir.inc";
  16. delete_directories();
  17. ?>
  18. --EXPECTF--
  19. *** Testing open_basedir configuration [copy] ***
  20. bool(true)
  21. bool(true)
  22. bool(true)
  23. bool(true)
  24. bool(true)
  25. Warning: copy(): open_basedir restriction in effect. File(../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d
  26. bool(false)
  27. Warning: unlink(copy.txt): No such file or directory in %s on line %d
  28. bool(false)
  29. *** Finished testing open_basedir configuration [copy] ***