File tree 2 files changed +14
-1
lines changed
2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -67,7 +67,7 @@ public function createTransaction(): TransactionInterface
67
67
68
68
public function getColumnFactory (): ColumnFactoryInterface
69
69
{
70
- return new ColumnFactory ();
70
+ return $ this -> columnFactory ??= new ColumnFactory ();
71
71
}
72
72
73
73
public function getQueryBuilder (): QueryBuilderInterface
Original file line number Diff line number Diff line change 12
12
use Yiisoft \Db \Exception \InvalidConfigException ;
13
13
use Yiisoft \Db \Exception \NotSupportedException ;
14
14
use Yiisoft \Db \Mysql \Column \ColumnFactory ;
15
+ use Yiisoft \Db \Mysql \Connection ;
15
16
use Yiisoft \Db \Mysql \Tests \Support \TestTrait ;
16
17
use Yiisoft \Db \Tests \Common \CommonConnectionTest ;
18
+ use Yiisoft \Db \Tests \Support \DbHelper ;
17
19
use Yiisoft \Db \Transaction \TransactionInterface ;
18
20
19
21
/**
@@ -168,4 +170,15 @@ public function testGetColumnFactory(): void
168
170
169
171
$ db ->close ();
170
172
}
173
+
174
+ public function testUserDefinedColumnFactory (): void
175
+ {
176
+ $ columnFactory = new ColumnFactory ();
177
+
178
+ $ db = new Connection ($ this ->getDriver (), DbHelper::getSchemaCache (), $ columnFactory );
179
+
180
+ $ this ->assertSame ($ columnFactory , $ db ->getColumnFactory ());
181
+
182
+ $ db ->close ();
183
+ }
171
184
}
You can’t perform that action at this time.
0 commit comments