fix test
[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 (9) {
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 ["diag"]=>
35 array(17) {
36 ["severity"]=>
37 string(5) "ERROR"
38 ["sqlstate"]=>
39 string(5) "57014"
40 ["message_primary"]=>
41 string(39) "canceling statement due to user request"
42 ["message_detail"]=>
43 NULL
44 ["message_hint"]=>
45 NULL
46 ["statement_position"]=>
47 NULL
48 ["internal_position"]=>
49 NULL
50 ["internal_query"]=>
51 NULL
52 ["context"]=>
53 NULL
54 ["schema_name"]=>
55 NULL
56 ["table_name"]=>
57 NULL
58 ["column_name"]=>
59 NULL
60 ["datatype_name"]=>
61 NULL
62 ["constraint_name"]=>
63 NULL
64 ["source_file"]=>
65 string(10) "postgres.c"
66 ["source_line"]=>
67 string(4) "%d"
68 ["source_function"]=>
69 string(17) "ProcessInterrupts"
70 }
71 ["numRows"]=>
72 int(0)
73 ["numCols"]=>
74 int(0)
75 ["affectedRows"]=>
76 int(0)
77 ["fetchType"]=>
78 int(0)
79 ["autoConvert"]=>
80 int(65535)
81 }
82 ERROR: canceling statement due to user request
83 DONE