d65cde5c60f15e62aa07a11b30359b75d84a570e
[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 (18) {
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 }
71 int(0)
72 bool(false)
73 bool(false)
74 object(pq\Connection)#%d (18) {
75 ["status"]=>
76 int(0)
77 ["transactionStatus"]=>
78 int(2)
79 ["socket"]=>
80 resource(%d) of type (stream)
81 ["errorMessage"]=>
82 string(0) ""
83 ["busy"]=>
84 bool(false)
85 ["encoding"]=>
86 string(4) "%s"
87 ["unbuffered"]=>
88 bool(false)
89 ["db"]=>
90 string(4) "%S"
91 ["user"]=>
92 string(4) "%S"
93 ["pass"]=>
94 string(0) "%S"
95 ["host"]=>
96 string(0) "%S"
97 ["port"]=>
98 string(4) "%S"
99 ["options"]=>
100 string(0) "%S"
101 ["eventHandlers"]=>
102 array(0) {
103 }
104 ["defaultFetchType"]=>
105 int(0)
106 ["defaultTransactionIsolation"]=>
107 int(0)
108 ["defaultTransactionReadonly"]=>
109 bool(false)
110 ["defaultTransactionDeferrable"]=>
111 bool(false)
112 }
113 int(2)
114 bool(true)
115 bool(true)
116 DONE