Annotation of embedaddon/php/ext/posix/tests/posix_getpgid_error.phpt, revision 1.1.1.1

1.1       misho       1: --TEST--
                      2: Test posix_getpgid() function : error conditions
                      3: --SKIPIF--
                      4: <?php 
                      5: if((!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: 
                     17: echo "*** Testing posix_getpgid() : error conditions ***\n";
                     18: 
                     19: echo "\n-- Testing posix_getpgid() function no arguments --\n";
                     20: var_dump( posix_getpgid() );
                     21: 
                     22: echo "\n-- Testing posix_getpgid() with one extra argument --\n";
                     23: $pid = 10;
                     24: $extra_arg = 20;
                     25: var_dump( posix_getpgid($pid, $extra_arg) );
                     26: 
                     27: echo "\n-- Testing posix_getpgid() with negative pid  --\n";
                     28: $pid = -99;
                     29: var_dump( posix_getpgid($pid) );
                     30: 
                     31: echo "Done";
                     32: ?>
                     33: --EXPECTF--
                     34: *** Testing posix_getpgid() : error conditions ***
                     35: 
                     36: -- Testing posix_getpgid() function no arguments --
                     37: 
                     38: Warning: posix_getpgid() expects exactly 1 parameter, 0 given in %s on line %d
                     39: bool(false)
                     40: 
                     41: -- Testing posix_getpgid() with one extra argument --
                     42: 
                     43: Warning: posix_getpgid() expects exactly 1 parameter, 2 given in %s on line %d
                     44: bool(false)
                     45: 
                     46: -- Testing posix_getpgid() with negative pid  --
                     47: bool(false)
                     48: Done

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>