diff options
author | Harald Eilertsen <haraldei@anduin.net> | 2023-09-11 21:53:06 +0200 |
---|---|---|
committer | Harald Eilertsen <haraldei@anduin.net> | 2023-09-11 21:53:06 +0200 |
commit | f5c68f507ec88876f02955fa18646f2bb3aa4512 (patch) | |
tree | 96542f697326a34a38967b04b84925a2d0a2e4a5 /tests | |
parent | 1344b0a68a278e5044872c7df1c0697dac387338 (diff) | |
download | volse-hubzilla-f5c68f507ec88876f02955fa18646f2bb3aa4512.tar.gz volse-hubzilla-f5c68f507ec88876f02955fa18646f2bb3aa4512.tar.bz2 volse-hubzilla-f5c68f507ec88876f02955fa18646f2bb3aa4512.zip |
tests: Add some db defaults in the UnitTestCase class
Diffstat (limited to 'tests')
-rw-r--r-- | tests/unit/UnitTestCase.php | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/tests/unit/UnitTestCase.php b/tests/unit/UnitTestCase.php index 8f104e6d0..6c787ae06 100644 --- a/tests/unit/UnitTestCase.php +++ b/tests/unit/UnitTestCase.php @@ -48,13 +48,15 @@ class UnitTestCase extends TestCase { public static function setUpBeforeClass() : void { if ( !\DBA::$dba ) { \DBA::dba_factory( - getenv('HZ_TEST_DB_HOST'), - getenv('HZ_TEST_DB_PORT', ''), - getenv('HZ_TEST_DB_USER'), - getenv('HZ_TEST_DB_PASS'), - getenv('HZ_TEST_DB_DATABASE'), - getenv('HZ_TEST_DB_TYPE'), - getenv('HZ_TEST_DB_CHARSET'), + getenv('HZ_TEST_DB_HOST') ?: 'db', + + // Use default port for db type if none specified + getenv('HZ_TEST_DB_PORT'), + 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, + getenv('HZ_TEST_DB_CHARSET') ?: 'UTF8', false); if ( !\DBA::$dba->connected ) { |