posix_access_safemode.phpt 574 B

12345678910111213141516171819202122232425
  1. --TEST--
  2. Test posix_access() with safe_mode enabled.
  3. --CREDITS--
  4. Till Klampaeckel, till@php.net
  5. TestFest Berlin 2009
  6. --SKIPIF--
  7. <?php
  8. if (!extension_loaded('posix')) {
  9. die('SKIP The posix extension is not loaded.');
  10. }
  11. if (posix_geteuid() == 0) {
  12. die('SKIP Cannot run test as root.');
  13. }
  14. if (PHP_VERSION_ID < 503099) {
  15. die('SKIP Safe mode is no longer available.');
  16. }
  17. --FILE--
  18. <?php
  19. var_dump(posix_access('/tmp', POSIX_W_OK));
  20. ?>
  21. ===DONE===
  22. --EXPECTF--
  23. Deprecated: Directive 'safe_mode' is deprecated in PHP 5.3 and greater in %s on line %d
  24. bool(false)
  25. ===DONE===