Annotation of embedaddon/php/ext/standard/tests/network/long2ip_error.phpt, revision 1.1.1.1

1.1       misho       1: --TEST--
                      2: Test long2ip() function : error conditions 
                      3: --FILE--
                      4: <?php
                      5: /* Prototype  : string long2ip(int proper_address)
                      6:  * Description: Converts an (IPv4) Internet network address into a string in Internet standard dotted format 
                      7:  * Source code: ext/standard/basic_functions.c
                      8:  * Alias to functions: 
                      9:  */
                     10: 
                     11: echo "*** Testing long2ip() : error conditions ***\n";
                     12: 
                     13: // Zero arguments
                     14: echo "\n-- Testing long2ip() function with Zero arguments --\n";
                     15: var_dump( long2ip() );
                     16: 
                     17: //Test long2ip with one more than the expected number of arguments
                     18: echo "\n-- Testing long2ip() function with more than expected no. of arguments --\n";
                     19: $proper_address = 10;
                     20: $extra_arg = 10;
                     21: var_dump( long2ip($proper_address, $extra_arg) );
                     22: 
                     23: ?>
                     24: ===DONE===
                     25: --EXPECTF--
                     26: *** Testing long2ip() : error conditions ***
                     27: 
                     28: -- Testing long2ip() function with Zero arguments --
                     29: 
                     30: Warning: long2ip() expects exactly 1 parameter, 0 given in %s on line %d
                     31: NULL
                     32: 
                     33: -- Testing long2ip() function with more than expected no. of arguments --
                     34: 
                     35: Warning: long2ip() expects exactly 1 parameter, 2 given in %s on line %d
                     36: NULL
                     37: ===DONE===

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