Annotation of embedaddon/php/tests/output/ob_start_error_001.phpt, revision 1.1.1.2

1.1       misho       1: --TEST--
                      2: Test wrong number of arguments and wrong arg types for ob_start()
                      3: --FILE--
                      4: <?php
                      5: /* 
                      6:  * proto bool ob_start([ string|array user_function [, int chunk_size [, bool erase]]])
                      7:  * Function is implemented in main/output.c
                      8: */ 
                      9: 
                     10: function justPrint($str) {
                     11:        return $str;
                     12: }
                     13: 
                     14: $arg_1 = "justPrint";
                     15: $arg_2 = 0;
                     16: $arg_3 = false;
                     17: $extra_arg = 1;
                     18: 
                     19: echo "\n- Too many arguments\n";
                     20: var_dump(ob_start($arg_1, $arg_2, $arg_3, $extra_arg));
                     21: 
                     22: echo "\n- Arg 1 wrong type\n";
                     23: var_dump(ob_start(1.5));
                     24: 
                     25: echo "\n- Arg 2 wrong type\n";
                     26: var_dump(ob_start("justPrint", "this should be an int"));
                     27: 
                     28: echo "\n- Arg 3 wrong type\n";
                     29: var_dump(ob_start("justPrint", 0, "this should be a bool"));
                     30: 
                     31: ?>
                     32: --EXPECTF--
                     33: - Too many arguments
                     34: 
                     35: Warning: ob_start() expects at most 3 parameters, 4 given in %s on line 17
                     36: NULL
                     37: 
                     38: - Arg 1 wrong type
1.1.1.2 ! misho      39: 
        !            40: Warning: ob_start(): no array or string given in %s on line 20
        !            41: 
        !            42: Notice: ob_start(): failed to create buffer in %s on line 20
        !            43: bool(false)
1.1       misho      44: 
                     45: - Arg 2 wrong type
                     46: 
                     47: Warning: ob_start() expects parameter 2 to be long, string given in %s on line 23
                     48: NULL
                     49: 
                     50: - Arg 3 wrong type
1.1.1.2 ! misho      51: 
        !            52: Warning: ob_start() expects parameter 3 to be long, string given in %s on line 26
        !            53: NULL

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