Annotation of embedaddon/php/ext/standard/tests/general_functions/ob_get_length_basic.phpt, revision 1.1.1.1

1.1       misho       1: --TEST--
                      2: Test ob_get_length() function : basic functionality 
                      3: --INI--
                      4: output_buffering=0
                      5: --FILE--
                      6: <?php
                      7: /* Prototype  : int ob_get_length(void)
                      8:  * Description: Return the length of the output buffer 
                      9:  * Source code: main/output.c
                     10:  * Alias to functions: 
                     11:  */
                     12: 
                     13: function dump_string_length( $string )
                     14: {
                     15:        ob_start();
                     16:        echo $string;
                     17:        $len = ob_get_length();
                     18:        ob_end_clean();
                     19:        var_dump( $len );
                     20: }
                     21: 
                     22: echo "*** Testing ob_get_length() : basic functionality ***\n";
                     23: 
                     24: // No buffering active
                     25: var_dump( ob_get_length() );
                     26: 
                     27: dump_string_length( 'foo bar length of a string' );
                     28: dump_string_length( 'plus one' );
                     29: dump_string_length( "\0" );
                     30: dump_string_length( '            lsf' );
                     31: dump_string_length( '' );
                     32: dump_string_length( null );
                     33: 
                     34: // Extra argument
                     35: var_dump( ob_get_length( 'foobar' ) );
                     36: 
                     37: ?>
                     38: ===DONE===
                     39: --EXPECTF--
                     40: *** Testing ob_get_length() : basic functionality ***
                     41: bool(false)
                     42: int(26)
                     43: int(8)
                     44: int(1)
                     45: int(15)
                     46: int(0)
                     47: int(0)
                     48: 
                     49: Warning: ob_get_length() expects exactly 0 parameters, 1 given in %s on line %d
                     50: NULL
                     51: ===DONE===

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