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

1.1       misho       1: --TEST--
                      2: Test gethostbynamel() function : error conditions 
                      3: --FILE--
                      4: <?php
                      5: /* Prototype  : proto array gethostbynamel(string hostname)
                      6:  * Description: Return a list of IP addresses that a given hostname resolves to. 
                      7:  * Source code: ext/standard/dns.c
                      8:  * Alias to functions: 
                      9:  */
                     10: 
                     11: echo "*** Testing gethostbynamel() : error conditions ***\n";
                     12: 
                     13: // Zero arguments
                     14: echo "\n-- Testing gethostbynamel() function with Zero arguments --\n";
                     15: var_dump( gethostbynamel() );
                     16: 
                     17: //Test gethostbynamel with one more than the expected number of arguments
                     18: echo "\n-- Testing gethostbynamel() function with more than expected no. of arguments --\n";
                     19: $hostname = 'string_val';
                     20: $extra_arg = 10;
                     21: var_dump( gethostbynamel($hostname, $extra_arg) );
                     22: echo "Done";
                     23: ?>
                     24: --EXPECTF--
                     25: *** Testing gethostbynamel() : error conditions ***
                     26: 
                     27: -- Testing gethostbynamel() function with Zero arguments --
                     28: 
                     29: Warning: gethostbynamel() expects exactly 1 parameter, 0 given in %s on line %d
                     30: NULL
                     31: 
                     32: -- Testing gethostbynamel() function with more than expected no. of arguments --
                     33: 
                     34: Warning: gethostbynamel() expects exactly 1 parameter, 2 given in %s on line %d
                     35: NULL
                     36: Done

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