prepare v2.2.3
[m6w6/ext-pq] / tests / async004.phpt
1 --TEST--
2 async exec params
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 = new pq\Types($c);
13 $c->execParamsAsync("SELECT \$1,\$2::int4", array(1,2), array($t["int4"]->oid), function ($res) {
14 var_dump($res);
15 });
16 do {
17 while ($c->busy) {
18 $r = array($c->socket);
19 $w = $e = null;
20 if (stream_select($r, $w, $e, null)) {
21 $c->poll();
22 }
23 }
24 } while ($c->getResult());
25
26 ?>
27 DONE
28 --EXPECTF--
29 Test
30 object(pq\Result)#%d (9) {
31 ["status"]=>
32 int(2)
33 ["statusMessage"]=>
34 string(9) "TUPLES_OK"
35 ["errorMessage"]=>
36 string(0) ""
37 ["diag"]=>
38 array(17) {
39 ["severity"]=>
40 NULL
41 ["sqlstate"]=>
42 NULL
43 ["message_primary"]=>
44 NULL
45 ["message_detail"]=>
46 NULL
47 ["message_hint"]=>
48 NULL
49 ["statement_position"]=>
50 NULL
51 ["internal_position"]=>
52 NULL
53 ["internal_query"]=>
54 NULL
55 ["context"]=>
56 NULL
57 ["schema_name"]=>
58 NULL
59 ["table_name"]=>
60 NULL
61 ["column_name"]=>
62 NULL
63 ["datatype_name"]=>
64 NULL
65 ["constraint_name"]=>
66 NULL
67 ["source_file"]=>
68 NULL
69 ["source_line"]=>
70 NULL
71 ["source_function"]=>
72 NULL
73 }
74 ["numRows"]=>
75 int(1)
76 ["numCols"]=>
77 int(2)
78 ["affectedRows"]=>
79 int(%d)
80 ["fetchType"]=>
81 int(0)
82 ["autoConvert"]=>
83 int(65535)
84 }
85 DONE