Annotation of embedaddon/php/ext/zlib/tests/gzopen_error.phpt, revision 1.1.1.1

1.1       misho       1: --TEST--
                      2: Test gzopen() function : error conditions 
                      3: --SKIPIF--
                      4: <?php 
                      5: if (!extension_loaded("zlib")) {
                      6:        print "skip - ZLIB extension not loaded"; 
                      7: }       
                      8: ?>
                      9: --FILE--
                     10: <?php
                     11: /* Prototype  : resource gzopen(string filename, string mode [, int use_include_path])
                     12:  * Description: Open a .gz-file and return a .gz-file pointer 
                     13:  * Source code: ext/zlib/zlib.c
                     14:  * Alias to functions: 
                     15:  */
                     16: 
                     17: echo "*** Testing gzopen() : error conditions ***\n";
                     18: 
                     19: 
                     20: //Test gzopen with one more than the expected number of arguments
                     21: echo "\n-- Testing gzopen() function with more than expected no. of arguments --\n";
                     22: $filename = 'string_val';
                     23: $mode = 'string_val';
                     24: $use_include_path = 10;
                     25: $extra_arg = 10;
                     26: var_dump( gzopen($filename, $mode, $use_include_path, $extra_arg) );
                     27: 
                     28: // Testing gzopen with one less than the expected number of arguments
                     29: echo "\n-- Testing gzopen() function with less than expected no. of arguments --\n";
                     30: $filename = 'string_val';
                     31: var_dump( gzopen($filename) );
                     32: 
                     33: ?>
                     34: ===DONE===
                     35: --EXPECTF--
                     36: *** Testing gzopen() : error conditions ***
                     37: 
                     38: -- Testing gzopen() function with more than expected no. of arguments --
                     39: 
                     40: Warning: gzopen() expects at most 3 parameters, 4 given in %s on line %d
                     41: NULL
                     42: 
                     43: -- Testing gzopen() function with less than expected no. of arguments --
                     44: 
                     45: Warning: gzopen() expects at least 2 parameters, 1 given in %s on line %d
                     46: NULL
                     47: ===DONE===

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