typo: oid of bool is 16, not 18
[m6w6/ext-pq] / tests / lob003.phpt
1 --TEST--
2 large object closing stream
3 --SKIPIF--
4 <?php include "_skipif.inc"; ?>
5 --FILE--
6 <?php
7 echo "Test\n";
8
9 include "_setup.inc";
10
11 $c = new pq\Connection(PQ_DSN);
12 $t = $c->startTransaction();
13
14 $lob = $t->createLOB();
15 var_dump($lob->stream);
16 var_dump($lob->stream);
17 fclose($lob->stream); // bad boy!
18 var_dump($lob->stream);
19 var_dump(fread($lob->stream, 5));
20 $lob = null;
21 ?>
22 DONE
23 --EXPECTF--
24 Test
25 resource(%d) of type (stream)
26 resource(%d) of type (stream)
27
28 Warning: fclose(): %d is not a valid stream resource in %s on line %d
29 resource(%d) of type (stream)
30 string(0) ""
31 DONE
32