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

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

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