diff options
-rw-r--r-- | tests/unit/UnitTestCase.php | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/tests/unit/UnitTestCase.php b/tests/unit/UnitTestCase.php index 6c787ae06..4e3cea1ec 100644 --- a/tests/unit/UnitTestCase.php +++ b/tests/unit/UnitTestCase.php @@ -55,7 +55,7 @@ class UnitTestCase extends TestCase { getenv('HZ_TEST_DB_USER') ?: 'test_user', getenv('HZ_TEST_DB_PASS') ?: 'hubzilla', getenv('HZ_TEST_DB_DATABASE') ?: 'hubzilla_test_db', - getenv('HZ_TEST_DB_TYPE') ?: 1, + Self::dbtype(getenv('HZ_TEST_DB_TYPE')), getenv('HZ_TEST_DB_CHARSET') ?: 'UTF8', false); @@ -94,6 +94,14 @@ class UnitTestCase extends TestCase { } } + private static function dbtype(string $type): int { + if (trim(strtolower($type)) === 'postgres') { + return DBTYPE_POSTGRES; + } else { + return DBTYPE_MYSQL; + } + } + private function loadFixtures() : void { $files = glob(__DIR__ . '/includes/dba/_files/*.yml'); if ($files === false || empty($files)) { |