Annotation of embedaddon/php/ext/standard/tests/url/parse_url_error_001.phpt, revision 1.1

1.1     ! misho       1: --TEST--
        !             2: Test parse_url() function : error conditions - wrong number of args
        !             3: --FILE--
        !             4: <?php
        !             5: /* Prototype  : proto mixed parse_url(string url, [int url_component])
        !             6:  * Description: Parse a URL and return its components 
        !             7:  * Source code: ext/standard/url.c
        !             8:  * Alias to functions: 
        !             9:  */
        !            10: 
        !            11: echo "*** Testing parse_url() : error conditions ***\n";
        !            12: 
        !            13: // Zero arguments
        !            14: echo "\n-- Testing parse_url() function with Zero arguments --\n";
        !            15: var_dump( parse_url() );
        !            16: 
        !            17: //Test parse_url with one more than the expected number of arguments
        !            18: echo "\n-- Testing parse_url() function with more than expected no. of arguments --\n";
        !            19: $url = 'string_val';
        !            20: $url_component = 10;
        !            21: $extra_arg = 10;
        !            22: var_dump( parse_url($url, $url_component, $extra_arg) );
        !            23: 
        !            24: echo "Done";
        !            25: ?>
        !            26: --EXPECTF--
        !            27: *** Testing parse_url() : error conditions ***
        !            28: 
        !            29: -- Testing parse_url() function with Zero arguments --
        !            30: 
        !            31: Warning: parse_url() expects at least 1 parameter, 0 given in %s on line 12
        !            32: NULL
        !            33: 
        !            34: -- Testing parse_url() function with more than expected no. of arguments --
        !            35: 
        !            36: Warning: parse_url() expects at most 2 parameters, 3 given in %s on line 19
        !            37: NULL
        !            38: Done

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