1--TEST--
2Test posix_access() function test error conditions
3--DESCRIPTION--
4checks if posix_access() failes for wrong permissions
5--CREDITS--
6Moritz Neuhaeuser, info@xcompile.net
7PHP Testfest Berlin 2009-05-10
8--SKIPIF--
9<?php
10if (!extension_loaded('posix')) {
11    die('SKIP The posix extension is not loaded.');
12}
13if (posix_geteuid() == 0) {
14    die('SKIP Cannot run test as root.');
15}
16if (PHP_VERSION_ID < 503099) {
17    die('SKIP Safe mode is no longer available.');
18}
19?>
20--FILE--
21<?php
22$filename = dirname(__FILE__) . '/foo.test';
23var_dump(posix_access($filename, POSIX_F_OK));
24$fp = fopen($filename,"w");
25fwrite($fp,"foo");
26fclose($fp);
27
28chmod ($filename, 0000);
29var_dump(posix_access($filename, POSIX_R_OK));
30var_dump(posix_access($filename, POSIX_W_OK));
31var_dump(posix_access($filename, POSIX_X_OK));
32?>
33===DONE===
34--CLEAN--
35<?php
36$filename = dirname(__FILE__) . '/foo.test';
37chmod ($filename, 0700);
38unlink($filename);
39?>
40--EXPECTF--
41WDeprecated: Directive 'safe_mode' is deprecated in PHP 5.3 and greater in Unknown on line %d
42bool(false)
43bool(false)
44bool(false)
45bool(false)
46===DONE===
47