1--TEST--
2Test posix_getpwuid() function : error conditions
3--SKIPIF--
4<?php
5	if(!extension_loaded("posix")) print "skip - POSIX extension not loaded";
6?>
7--FILE--
8<?php
9/* Prototype  : proto array posix_getpwuid(long uid)
10 * Description: User database access (POSIX.1, 9.2.2)
11 * Source code: ext/posix/posix.c
12 * Alias to functions:
13 */
14
15echo "*** Testing posix_getpwuid() : error conditions ***\n";
16
17echo "\n-- Testing posix_getpwuid() function with Zero arguments --\n";
18var_dump( posix_getpwuid() );
19
20echo "\n-- Testing posix_getpwuid() function with more than expected no. of arguments --\n";
21$uid = posix_getuid();
22$extra_arg = 10;
23var_dump( posix_getpwuid($uid, $extra_arg) );
24
25echo "\n-- Testing posix_getpwuid() function negative uid --\n";
26$uid = -99;
27var_dump( posix_getpwuid($uid) );
28
29echo "Done";
30?>
31--EXPECTF--
32*** Testing posix_getpwuid() : error conditions ***
33
34-- Testing posix_getpwuid() function with Zero arguments --
35
36Warning: posix_getpwuid() expects exactly 1 parameter, 0 given in %s on line %d
37bool(false)
38
39-- Testing posix_getpwuid() function with more than expected no. of arguments --
40
41Warning: posix_getpwuid() expects exactly 1 parameter, 2 given in %s on line %d
42bool(false)
43
44-- Testing posix_getpwuid() function negative uid --
45bool(false)
46Done
47