Annotation of embedaddon/php/ext/standard/tests/file/parse_ini_file_error.phpt, revision 1.1

1.1     ! misho       1: --TEST--
        !             2: Test parse_ini_file() function : error conditions 
        !             3: --FILE--
        !             4: <?php
        !             5: /* Prototype  : proto array parse_ini_file(string filename [, bool process_sections])
        !             6:  * Description: Parse configuration file 
        !             7:  * Source code: ext/standard/basic_functions.c
        !             8:  * Alias to functions: 
        !             9:  */
        !            10: 
        !            11: echo "*** Testing parse_ini_file() : error conditions ***\n";
        !            12: 
        !            13: // Zero arguments
        !            14: echo "\n-- Testing parse_ini_file() function with Zero arguments --\n";
        !            15: var_dump( parse_ini_file() );
        !            16: 
        !            17: //Test parse_ini_file with one more than the expected number of arguments
        !            18: echo "\n-- Testing parse_ini_file() function with more than expected no. of arguments --\n";
        !            19: $filename = 'string_val';
        !            20: $process_sections = true;
        !            21: $extra_arg = 10;
        !            22: var_dump( parse_ini_file($filename, $process_sections, $extra_arg) );
        !            23: 
        !            24: echo "\n-- Testing parse_ini_file() function with a non-existent file --\n";
        !            25: $filename = __FILE__ . 'invalidfilename';
        !            26: var_dump( parse_ini_file($filename, $process_sections) ); 
        !            27: 
        !            28: echo "Done";
        !            29: ?>
        !            30: --EXPECTF--
        !            31: *** Testing parse_ini_file() : error conditions ***
        !            32: 
        !            33: -- Testing parse_ini_file() function with Zero arguments --
        !            34: 
        !            35: Warning: parse_ini_file() expects at least 1 parameter, 0 given in %s on line %d
        !            36: bool(false)
        !            37: 
        !            38: -- Testing parse_ini_file() function with more than expected no. of arguments --
        !            39: 
        !            40: Warning: parse_ini_file(%s): failed to open stream: No such file or directory in %s on line %d
        !            41: bool(false)
        !            42: 
        !            43: -- Testing parse_ini_file() function with a non-existent file --
        !            44: 
        !            45: Warning: parse_ini_file(%s): failed to open stream: No such file or directory in %s on line %d
        !            46: bool(false)
        !            47: Done

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