'mariadb', 'read' => [ 'host' => 'localhost', ], 'write' => [ 'host' => 'localhost', ], 'sticky' => true, 'database' => 'test_db', 'username' => 'username', 'password' => 'password', 'charset' => 'utf8', 'collation' => 'utf8_unicode_ci', 'prefix' => '', 'port' => '3306', ]; $result1 = DB::getConfig(); $this->assertEquals($expected1, $result1); // Scenario 2: enable_db_rw_split is false $_ENV['enable_db_rw_split'] = false; $_ENV['db_host'] = 'localhost'; $_ENV['db_socket'] = '/tmp/mysql.sock'; $expected2 = [ 'driver' => 'mariadb', 'host' => 'localhost', 'unix_socket' => '/tmp/mysql.sock', 'database' => 'test_db', 'username' => 'username', 'password' => 'password', 'charset' => 'utf8', 'collation' => 'utf8_unicode_ci', 'prefix' => '', 'port' => '3306', ]; $result2 = DB::getConfig(); $this->assertEquals($expected2, $result2); } }