Annotation of embedaddon/php/ext/spl/tests/SplFileObject_fflush_basic_001.phpt, revision 1.1.1.2
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)
1.1.1.2 ! misho 20: {
1.1 misho 21: return true;
22: }
1.1.1.2 ! misho 23:
! 24: function url_stat() {
! 25: }
1.1 misho 26: }
27: stream_wrapper_register("SPLtest", "VariableStream");
28: $ftruncate_test = "";
29: //end creating stream
30:
31: //open an SplFileObject using the above test stream
32: $obj = New SplFileObject("SPLtest://ftruncate_test");
33: var_dump($obj->fflush());
34:
35: ?>
36: --EXPECTF--
37: bool(true)
38: bool(false)
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>