Merge pull request #34 from JustBlackBird/empty-array-fix
[m6w6/ext-pq] / tests / callback002.phpt
1 --TEST--
2 callback sanity
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 $c->execAsync("select 1; select 2", function($r) {
13 print_r($r->fetchAll());
14 });
15 try {
16 $c->execAsync("select 3; select 4", function($r) {
17
18 });
19 } catch (Exception $e) {
20 printf("%s\n", $e->getMessage());
21 }
22 $c->exec("");
23 ?>
24 ===DONE===
25 --EXPECT--
26 Test
27 Failed to execute query (another command is already in progress)
28 Array
29 (
30 [0] => Array
31 (
32 [0] => 1
33 )
34
35 )
36 Array
37 (
38 [0] => Array
39 (
40 [0] => 2
41 )
42
43 )
44 ===DONE===