Skip to content

Commit 74e44a9

Browse files
committed
Update BaseUnitTest.php
Fix for multi-db
1 parent edeaadc commit 74e44a9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/unit/BaseUnitTest.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,10 @@ protected function _startRouter($what = false) {
5555
}
5656
}
5757

58-
protected function _startDatabase(DAO $dao) {
59-
$db = $this->config ["database"] ?? [ ];
58+
protected function _startDatabase(DAO $dao, $dbOffset = 'default') {
59+
$db = DAO::getDbOffset ( $this->config, $dbOffset );
6060
if ($db ["dbName"] !== "") {
61-
$dao->connect ( $db ["type"]??'mysql', $db ["dbName"], $db ["serverName"] ?? '127.0.0.1', $db ["port"] ?? 3306, $db ["user"] ?? 'root', $db ["password"] ?? '', $db ["options"] ?? [ ], $db ["cache"] ?? false);
61+
$dao->connect ( $dbOffset, $db ["type"] ?? 'mysql', $db ["dbName"], $db ["serverName"] ?? '127.0.0.1', $db ["port"] ?? 3306, $db ["user"] ?? 'root', $db ["password"] ?? '', $db ["options"] ?? [ ], $db ["cache"] ?? false);
6262
}
6363
}
6464

0 commit comments

Comments
 (0)