1--TEST-- 2Test posix_getpgid() function : error conditions 3--SKIPIF-- 4<?php 5if((!extension_loaded("posix")) || (!function_exists("posix_getpgid"))) { 6 print "skip - POSIX extension not loaded or posix_getpgid() does not exist"; 7} 8?> 9--FILE-- 10<?php 11/* Prototype : proto int posix_getpgid(void) 12 * Description: Get the process group id of the specified process (This is not a POSIX function, but a SVR4ism, so we compile conditionally) 13 * Source code: ext/posix/posix.c 14 * Alias to functions: 15 */ 16 17echo "*** Testing posix_getpgid() : error conditions ***\n"; 18 19echo "\n-- Testing posix_getpgid() function no arguments --\n"; 20var_dump( posix_getpgid() ); 21 22echo "\n-- Testing posix_getpgid() with one extra argument --\n"; 23$pid = 10; 24$extra_arg = 20; 25var_dump( posix_getpgid($pid, $extra_arg) ); 26 27echo "\n-- Testing posix_getpgid() with negative pid --\n"; 28$pid = -99; 29var_dump( posix_getpgid($pid) ); 30 31echo "Done"; 32?> 33--EXPECTF-- 34*** Testing posix_getpgid() : error conditions *** 35 36-- Testing posix_getpgid() function no arguments -- 37 38Warning: posix_getpgid() expects exactly 1 parameter, 0 given in %s on line %d 39bool(false) 40 41-- Testing posix_getpgid() with one extra argument -- 42 43Warning: posix_getpgid() expects exactly 1 parameter, 2 given in %s on line %d 44bool(false) 45 46-- Testing posix_getpgid() with negative pid -- 47bool(false) 48Done 49