1--TEST--
2SQLite3::execute() with a resource bound for blob param
3--EXTENSIONS--
4sqlite3
5--FILE--
6<?php
7
8require_once(__DIR__ . '/new_db.inc');
9require_once(__DIR__ . '/stream_test.inc');
10
11var_dump($db->exec('CREATE TABLE test (id STRING, data BLOB)'));
12$insert_stmt = $db->prepare("INSERT INTO test (id, data) VALUES (1, ?)");
13
14
15class HelloWrapper {
16    public function stream_open() { return true; }
17    public function stream_eof() { return true; }
18    public function stream_read() { return NULL; }
19    public function stream_stat() { return array(); }
20}
21stream_wrapper_register("hello", "HelloWrapper");
22
23$f = fopen("hello://there", "r");
24
25var_dump($insert_stmt->bindParam(1, $f, SQLITE3_BLOB));
26var_dump($insert_stmt->execute());
27
28var_dump($insert_stmt->close());
29fclose($f);
30
31?>
32+++DONE+++
33--EXPECTF--
34bool(true)
35bool(true)
36object(SQLite3Result)#%d (%d) {
37}
38bool(true)
39+++DONE+++
40