fix package.xml
[m6w6/ext-pq] / tests / trans002.phpt
1 --TEST--
2 txn properties
3 --SKIPIF--
4 <?php include "_skipif.inc"; ?>
5 --FILE--
6 <?php
7 echo "Test\n";
8
9 include "_setup.inc";
10
11 $t = new pq\Transaction(new pq\Connection(PQ_DSN));
12 var_dump(
13 $t->connection,
14 $t->isolation,
15 $t->readonly,
16 $t->deferrable
17 );
18
19 $t->isolation = pq\Transaction::SERIALIZABLE;
20 $t->readonly = true;
21 $t->deferrable = true;
22 var_dump(
23 $t->connection,
24 $t->isolation,
25 $t->readonly,
26 $t->deferrable
27 );
28 ?>
29 DONE
30 --EXPECTF--
31 Test
32 object(pq\Connection)#%d (19) {
33 ["status"]=>
34 int(0)
35 ["transactionStatus"]=>
36 int(2)
37 ["socket"]=>
38 resource(%d) of type (stream)
39 ["errorMessage"]=>
40 string(0) ""
41 ["busy"]=>
42 bool(false)
43 ["encoding"]=>
44 string(4) "%s"
45 ["unbuffered"]=>
46 bool(false)
47 ["db"]=>
48 string(4) "%S"
49 ["user"]=>
50 string(4) "%S"
51 ["pass"]=>
52 string(0) "%S"
53 ["host"]=>
54 string(0) "%S"
55 ["port"]=>
56 string(4) "%S"
57 ["options"]=>
58 string(0) "%S"
59 ["eventHandlers"]=>
60 array(0) {
61 }
62 ["defaultFetchType"]=>
63 int(0)
64 ["defaultTransactionIsolation"]=>
65 int(0)
66 ["defaultTransactionReadonly"]=>
67 bool(false)
68 ["defaultTransactionDeferrable"]=>
69 bool(false)
70 ["defaultAutoConvert"]=>
71 int(255)
72 }
73 int(0)
74 bool(false)
75 bool(false)
76 object(pq\Connection)#%d (19) {
77 ["status"]=>
78 int(0)
79 ["transactionStatus"]=>
80 int(2)
81 ["socket"]=>
82 resource(%d) of type (stream)
83 ["errorMessage"]=>
84 string(0) ""
85 ["busy"]=>
86 bool(false)
87 ["encoding"]=>
88 string(4) "%s"
89 ["unbuffered"]=>
90 bool(false)
91 ["db"]=>
92 string(4) "%S"
93 ["user"]=>
94 string(4) "%S"
95 ["pass"]=>
96 string(0) "%S"
97 ["host"]=>
98 string(0) "%S"
99 ["port"]=>
100 string(4) "%S"
101 ["options"]=>
102 string(0) "%S"
103 ["eventHandlers"]=>
104 array(0) {
105 }
106 ["defaultFetchType"]=>
107 int(0)
108 ["defaultTransactionIsolation"]=>
109 int(0)
110 ["defaultTransactionReadonly"]=>
111 bool(false)
112 ["defaultTransactionDeferrable"]=>
113 bool(false)
114 ["defaultAutoConvert"]=>
115 int(255)
116 }
117 int(2)
118 bool(true)
119 bool(true)
120 DONE