File tree Expand file tree Collapse file tree 2 files changed +26
-20
lines changed Expand file tree Collapse file tree 2 files changed +26
-20
lines changed Original file line number Diff line number Diff line change @@ -366,16 +366,17 @@ abstract class BaseConnection implements ConnectionInterface
366366 */
367367 public function __construct (array $ params )
368368 {
369+ if (isset ($ params ['dateFormat ' ])) {
370+ $ this ->dateFormat = array_merge ($ this ->dateFormat , $ params ['dateFormat ' ]);
371+ unset($ params ['dateFormat ' ]);
372+ }
373+
369374 foreach ($ params as $ key => $ value ) {
370375 if (property_exists ($ this , $ key )) {
371376 $ this ->{$ key } = $ value ;
372377 }
373378 }
374379
375- if (isset ($ params ['dateFormat ' ])) {
376- $ this ->dateFormat = array_merge ($ this ->dateFormat , $ params ['dateFormat ' ]);
377- }
378-
379380 $ queryClass = str_replace ('Connection ' , 'Query ' , static ::class);
380381
381382 if (class_exists ($ queryClass )) {
Original file line number Diff line number Diff line change 2626final class BaseConnectionTest extends CIUnitTestCase
2727{
2828 private array $ options = [
29- 'DSN ' => '' ,
30- 'hostname ' => 'localhost ' ,
31- 'username ' => 'first ' ,
32- 'password ' => 'last ' ,
33- 'database ' => 'dbname ' ,
34- 'DBDriver ' => 'MockDriver ' ,
35- 'DBPrefix ' => 'test_ ' ,
36- 'pConnect ' => true ,
37- 'DBDebug ' => true ,
38- 'charset ' => 'utf8mb4 ' ,
39- 'DBCollat ' => 'utf8mb4_general_ci ' ,
40- 'swapPre ' => '' ,
41- 'encrypt ' => false ,
42- 'compress ' => false ,
43- 'strictOn ' => true ,
44- 'failover ' => [],
29+ 'DSN ' => '' ,
30+ 'hostname ' => 'localhost ' ,
31+ 'username ' => 'first ' ,
32+ 'password ' => 'last ' ,
33+ 'database ' => 'dbname ' ,
34+ 'DBDriver ' => 'MockDriver ' ,
35+ 'DBPrefix ' => 'test_ ' ,
36+ 'pConnect ' => true ,
37+ 'DBDebug ' => true ,
38+ 'charset ' => 'utf8mb4 ' ,
39+ 'DBCollat ' => 'utf8mb4_general_ci ' ,
40+ 'swapPre ' => '' ,
41+ 'encrypt ' => false ,
42+ 'compress ' => false ,
43+ 'strictOn ' => true ,
44+ 'failover ' => [],
45+ 'dateFormat ' => [
46+ 'date ' => 'Y-m-d ' ,
47+ 'datetime ' => 'Y-m-d H:i:s ' ,
48+ 'time ' => 'H:i:s ' ,
49+ ],
4550 ];
4651 private array $ failoverOptions = [
4752 'DSN ' => '' ,
You can’t perform that action at this time.
0 commit comments