1--TEST-- 2Test posix_access() function : parameter validation 3--DESCRIPTION-- 4cases: no params, wrong param1, wrong param2, null directory, wrong directory, 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 23var_dump( posix_access() ); 24var_dump( posix_access(array()) ); 25var_dump( posix_access('foo',array()) ); 26var_dump( posix_access(null) ); 27 28var_dump(posix_access('./foobar')); 29?> 30===DONE=== 31--EXPECTF-- 32Deprecated: Directive 'safe_mode' is deprecated in PHP 5.3 and greater in Unknown on line 0 33 34Warning: posix_access() expects at least 1 parameter, 0 given in %s on line %d 35bool(false) 36 37Warning: posix_access() expects parameter 1 to be string, array given in %s on line %d 38bool(false) 39 40Warning: posix_access() expects parameter 2 to be integer, array given in %s on line %d 41bool(false) 42bool(false) 43bool(false) 44===DONE=== 45