refactor auto conversion
[m6w6/ext-pq] / tests / cancel001.phpt
1 --TEST--
2 cancel
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
13 $x = new pq\Cancel($c);
14
15 $c->execAsync("SELECT pg_sleep(2)");
16
17 $x->cancel();
18
19 var_dump($c === $x->connection);
20 var_dump($c->getResult());
21 printf("%s\n", $c->errorMessage);
22 ?>
23 DONE
24 --EXPECTF--
25 Test
26 bool(true)
27 object(pq\Result)#%d (7) {
28 ["status"]=>
29 int(7)
30 ["statusMessage"]=>
31 string(11) "FATAL_ERROR"
32 ["errorMessage"]=>
33 string(47) "ERROR: canceling statement due to user request"
34 ["numRows"]=>
35 int(0)
36 ["numCols"]=>
37 int(0)
38 ["affectedRows"]=>
39 int(0)
40 ["fetchType"]=>
41 int(0)
42 }
43 ERROR: canceling statement due to user request
44 DONE