Annotation of embedaddon/php/ext/spl/tests/SplFileObject_fflush_basic_001.phpt, revision 1.1.1.1

1.1       misho       1: --TEST--
                      2: SplFileObject::fflush function - basic test 
                      3: --FILE--
                      4: <?php
                      5: /*
                      6:  * test a successful flush
                      7: */
                      8: $obj = New SplFileObject(dirname(__FILE__).'/SplFileObject_testinput.csv');
                      9: var_dump($obj->fflush());
                     10: 
                     11: /*
                     12:  * test a unsuccessful flush
                     13: */
                     14: //create a basic stream class
                     15: class VariableStream {
                     16:     var $position;
                     17:     var $varname;
                     18: 
                     19:     function stream_open($path, $mode, $options, &$opened_path)
                     20:     {  
                     21:         return true;
                     22:     }
                     23: }
                     24: stream_wrapper_register("SPLtest", "VariableStream");
                     25: $ftruncate_test = "";
                     26: //end creating stream
                     27: 
                     28: //open an SplFileObject using the above test stream
                     29: $obj = New SplFileObject("SPLtest://ftruncate_test");
                     30: var_dump($obj->fflush());
                     31: 
                     32: ?>
                     33: --EXPECTF--
                     34: bool(true)
                     35: bool(false)

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