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