File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ public function createTransaction(): TransactionInterface
48
48
49
49
public function getColumnFactory (): ColumnFactoryInterface
50
50
{
51
- return new ColumnFactory ();
51
+ return $ this -> columnFactory ??= new ColumnFactory ();
52
52
}
53
53
54
54
public function getLastInsertID (?string $ sequenceName = null ): string
Original file line number Diff line number Diff line change 11
11
use Yiisoft \Db \Exception \InvalidConfigException ;
12
12
use Yiisoft \Db \Exception \NotSupportedException ;
13
13
use Yiisoft \Db \Pgsql \Column \ColumnFactory ;
14
+ use Yiisoft \Db \Pgsql \Connection ;
14
15
use Yiisoft \Db \Pgsql \Tests \Support \TestTrait ;
15
16
use Yiisoft \Db \Tests \Common \CommonConnectionTest ;
17
+ use Yiisoft \Db \Tests \Support \DbHelper ;
16
18
use Yiisoft \Db \Transaction \TransactionInterface ;
17
19
18
20
/**
@@ -143,4 +145,15 @@ public function testGetColumnFactory(): void
143
145
144
146
$ db ->close ();
145
147
}
148
+
149
+ public function testUserDefinedColumnFactory (): void
150
+ {
151
+ $ columnFactory = new ColumnFactory ();
152
+
153
+ $ db = new Connection ($ this ->getDriver (), DbHelper::getSchemaCache (), $ columnFactory );
154
+
155
+ $ this ->assertSame ($ columnFactory , $ db ->getColumnFactory ());
156
+
157
+ $ db ->close ();
158
+ }
146
159
}
You can’t perform that action at this time.
0 commit comments