1--TEST--
2Test posix_getgrgid() 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_getgrgid(long gid)
10 * Description: Group database access (POSIX.1, 9.2.1)
11 * Source code: ext/posix/posix.c
12 * Alias to functions:
13 */
14
15echo "*** Testing posix_getgrgid() : error conditions ***\n";
16
17// Zero arguments
18echo "\n-- Testing posix_getgrgid() function with Zero arguments --\n";
19var_dump( posix_getgrgid() );
20
21//Test posix_getgrgid with one more than the expected number of arguments
22echo "\n-- Testing posix_getgrgid() function with more than expected no. of arguments --\n";
23
24$extra_arg = 10;
25$gid = 0;
26var_dump( posix_getgrgid($gid, $extra_arg) );
27
28echo "\n-- Testing posix_getgrgid() function with a negative group id --\n";
29$gid = -999;
30var_dump( posix_getgrgid($gid));
31
32echo "Done";
33?>
34--EXPECTF--
35*** Testing posix_getgrgid() : error conditions ***
36
37-- Testing posix_getgrgid() function with Zero arguments --
38
39Warning: posix_getgrgid() expects exactly 1 parameter, 0 given in %s on line %d
40bool(false)
41
42-- Testing posix_getgrgid() function with more than expected no. of arguments --
43
44Warning: posix_getgrgid() expects exactly 1 parameter, 2 given in %s on line %d
45bool(false)
46
47-- Testing posix_getgrgid() function with a negative group id --
48bool(false)
49Done
50