Multi database setup
diff --git a/tests/mocks/database/ci_test.sqlite b/tests/mocks/database/ci_test.sqlite
new file mode 100755
index 0000000..37ce4f8
--- /dev/null
+++ b/tests/mocks/database/ci_test.sqlite
Binary files differ
diff --git a/tests/mocks/database/config/mysql.php b/tests/mocks/database/config/mysql.php
new file mode 100644
index 0000000..ace0a31
--- /dev/null
+++ b/tests/mocks/database/config/mysql.php
@@ -0,0 +1,34 @@
+<?php
+
+return array(
+	
+	// Typical Database configuration
+	'mysql' => array(
+		'dsn' => '',
+		'hostname' => 'localhost',
+		'username' => 'travis',
+		'password' => '',
+		'database' => 'ci_test',
+		'dbdriver' => 'mysql',
+	),
+
+	// Database configuration with failover
+	'mysql_failover' => array(
+		'dsn' => '',
+		'hostname' => 'localhost',
+		'username' => 'not_travis',
+		'password' => 'wrong password',
+		'database' => 'not_ci_test',
+		'dbdriver' => 'mysql',
+		'failover' => array(
+			array(
+				'dsn' => '',
+				'hostname' => 'localhost',
+				'username' => 'travis',
+				'password' => '',
+				'database' => 'ci_test',
+				'dbdriver' => 'mysql',
+			),
+		),
+	),
+);
\ No newline at end of file
diff --git a/tests/mocks/database/config/pgsql.php b/tests/mocks/database/config/pgsql.php
new file mode 100644
index 0000000..c06af8c
--- /dev/null
+++ b/tests/mocks/database/config/pgsql.php
@@ -0,0 +1,34 @@
+<?php
+
+return array(
+	
+	// Typical Database configuration
+	'pgsql' => array(
+		'dsn' => '',
+		'hostname' => 'localhost',
+		'username' => 'postgres',
+		'password' => '',
+		'database' => 'ci_test',
+		'dbdriver' => 'postgre',
+	),
+
+	// Database configuration with failover
+	'pgsql_failover' => array(
+		'dsn' => '',
+		'hostname' => 'localhost',
+		'username' => 'not_travis',
+		'password' => 'wrong password',
+		'database' => 'not_ci_test',
+		'dbdriver' => 'postgre',
+		'failover' => array(
+			array(
+				'dsn' => '',
+				'hostname' => 'localhost',
+				'username' => 'postgres',
+				'password' => '',
+				'database' => 'ci_test',
+				'dbdriver' => 'postgre',
+			),
+		),
+	),
+);
\ No newline at end of file
diff --git a/tests/mocks/database/config/sqlite.php b/tests/mocks/database/config/sqlite.php
new file mode 100644
index 0000000..cf428f4
--- /dev/null
+++ b/tests/mocks/database/config/sqlite.php
@@ -0,0 +1,34 @@
+<?php
+
+return array(
+	
+	// Typical Database configuration
+	'sqlite' => array(
+		'dsn' => '',
+		'hostname' => 'localhost',
+		'username' => 'sqlite',
+		'password' => 'sqlite',
+		'database' => realpath(__DIR__.'/..').'/ci_test.sqlite',
+		'dbdriver' => 'sqlite',
+	),
+
+	// Database configuration with failover
+	'sqlite_failover' => array(
+		'dsn' => '',
+		'hostname' => 'localhost',
+		'username' => 'sqlite',
+		'password' => 'sqlite',
+		'database' => '../not_exists.sqlite',
+		'dbdriver' => 'sqlite',
+		'failover' => array(
+			array(
+				'dsn' => '',
+				'hostname' => 'localhost',
+				'username' => 'sqlite',
+				'password' => 'sqlite',
+				'database' => realpath(__DIR__.'/..').'/ci_testf.sqlite',
+				'dbdriver' => 'sqlite',
+			),
+		),
+	),
+);
\ No newline at end of file
diff --git a/tests/mocks/database/db.php b/tests/mocks/database/db.php
index 11e4a93..43a0d39 100644
--- a/tests/mocks/database/db.php
+++ b/tests/mocks/database/db.php
@@ -2,6 +2,9 @@
 
 class Mock_Database_DB {
 
+	/**
+	 * @var array DB configuration
+	 */
 	private $config = array();
 	
 	/**
@@ -15,6 +18,12 @@
 		$this->config = $config;
 	}
 
+	/**
+	 * Build DSN connection string for DB driver instantiate process
+	 *
+	 * @param 	string 	Group name 		
+	 * @return 	string 	DSN Connection string
+	 */
 	public function set_dsn($group = 'default')
 	{
 		if ( ! isset($this->config[$group]))
@@ -25,7 +34,7 @@
 		$params = array(
 			'dbprefix' => '',
 			'pconnect' => FALSE,
-			'db_debug' => TRUE,
+			'db_debug' => FALSE,
 			'cache_on' => FALSE,
 			'cachedir' => '',
 			'char_set' => 'utf8',
@@ -33,7 +42,6 @@
 			'swap_pre' => '',
 			'autoinit' => TRUE,
 			'stricton' => FALSE,
-			'failover' => array()
 		);
 
 		$config = array_merge($this->config[$group], $params);
@@ -51,9 +59,30 @@
 
 		$other_params = array_slice($config, 6);
 
-		return $dsn.http_build_query($other_params);
+		return $dsn.'?'.http_build_query($other_params);
 	}
 
+	/**
+	 * Return a database config array
+	 *
+	 * @see 	./config
+	 * @param 	string 		Driver based configuration
+	 * @return 	array 		
+	 */
+	public static function config($driver)
+	{
+		$dir = realpath(dirname(__FILE__)).DIRECTORY_SEPARATOR;
+
+		return include($dir.'config'.DIRECTORY_SEPARATOR.$driver.'.php');
+	}
+
+	/**
+	 * Main DB method wrapper
+	 *
+	 * @param 	string 		Group or DSN string
+	 * @param 	bool 		
+	 * @return 	object 		
+	 */
 	public static function DB($group, $query_builder = FALSE)
 	{
 		include_once(BASEPATH.'database/DB.php');