Cleanup/optimize tests/mocks/
diff --git a/tests/mocks/database/config/mysql.php b/tests/mocks/database/config/mysql.php
index ace0a31..a590b9f 100644
--- a/tests/mocks/database/config/mysql.php
+++ b/tests/mocks/database/config/mysql.php
@@ -1,7 +1,7 @@
 <?php
 
 return array(
-	
+
 	// Typical Database configuration
 	'mysql' => array(
 		'dsn' => '',
@@ -9,7 +9,7 @@
 		'username' => 'travis',
 		'password' => '',
 		'database' => 'ci_test',
-		'dbdriver' => 'mysql',
+		'dbdriver' => 'mysql'
 	),
 
 	// Database configuration with failover
@@ -28,7 +28,7 @@
 				'password' => '',
 				'database' => 'ci_test',
 				'dbdriver' => 'mysql',
-			),
-		),
-	),
+			)
+		)
+	)
 );
\ No newline at end of file
diff --git a/tests/mocks/database/config/pdo/mysql.php b/tests/mocks/database/config/pdo/mysql.php
index cefb6b0..fefe0d6 100644
--- a/tests/mocks/database/config/pdo/mysql.php
+++ b/tests/mocks/database/config/pdo/mysql.php
@@ -1,7 +1,7 @@
 <?php
 
 return array(
-	
+
 	// Typical Database configuration
 	'pdo/mysql' => array(
 		'dsn' => '',
@@ -10,7 +10,7 @@
 		'password' => '',
 		'database' => 'ci_test',
 		'dbdriver' => 'pdo',
-		'pdodriver' => 'mysql',
+		'pdodriver' => 'mysql'
 	),
 
 	// Database configuration with failover
@@ -30,8 +30,8 @@
 				'password' => '',
 				'database' => 'ci_test',
 				'dbdriver' => 'pdo',
-				'pdodriver' => 'mysql',
-			),
-		),
-	),
+				'pdodriver' => 'mysql'
+			)
+		)
+	)
 );
\ No newline at end of file
diff --git a/tests/mocks/database/config/pdo/pgsql.php b/tests/mocks/database/config/pdo/pgsql.php
index 5196e9a..ddd638c 100644
--- a/tests/mocks/database/config/pdo/pgsql.php
+++ b/tests/mocks/database/config/pdo/pgsql.php
@@ -1,7 +1,7 @@
 <?php
 
 return array(
-	
+
 	// Typical Database configuration
 	'pdo/pgsql' => array(
 		'dsn' => 'pgsql:host=localhost;port=5432;dbname=ci_test;',
@@ -10,7 +10,7 @@
 		'password' => '',
 		'database' => 'ci_test',
 		'dbdriver' => 'pdo',
-		'pdodriver' => 'pgsql',
+		'pdodriver' => 'pgsql'
 	),
 
 	// Database configuration with failover
@@ -30,8 +30,8 @@
 				'password' => '',
 				'database' => 'ci_test',
 				'dbdriver' => 'pdo',
-				'pdodriver' => 'pgsql',
-			),
-		),
-	),
+				'pdodriver' => 'pgsql'
+			)
+		)
+	)
 );
\ No newline at end of file
diff --git a/tests/mocks/database/config/pdo/sqlite.php b/tests/mocks/database/config/pdo/sqlite.php
index c68b4b2..3646184 100644
--- a/tests/mocks/database/config/pdo/sqlite.php
+++ b/tests/mocks/database/config/pdo/sqlite.php
@@ -10,7 +10,7 @@
 		'password' => 'sqlite',
 		'database' => 'sqlite',
 		'dbdriver' => 'pdo',
-		'pdodriver' => 'sqlite',
+		'pdodriver' => 'sqlite'
 	),
 
 	// Database configuration with failover
@@ -29,9 +29,9 @@
 				'username' => 'sqlite',
 				'password' => 'sqlite',
 				'database' => 'sqlite',
-				'dbdriver' => 'pdo', 
-				'pdodriver' => 'sqlite',
-			),
-		),
-	),
+				'dbdriver' => 'pdo',
+				'pdodriver' => 'sqlite'
+			)
+		)
+	)
 );
\ No newline at end of file
diff --git a/tests/mocks/database/config/pgsql.php b/tests/mocks/database/config/pgsql.php
index c06af8c..1444b00 100644
--- a/tests/mocks/database/config/pgsql.php
+++ b/tests/mocks/database/config/pgsql.php
@@ -1,7 +1,7 @@
 <?php
 
 return array(
-	
+
 	// Typical Database configuration
 	'pgsql' => array(
 		'dsn' => '',
@@ -9,7 +9,7 @@
 		'username' => 'postgres',
 		'password' => '',
 		'database' => 'ci_test',
-		'dbdriver' => 'postgre',
+		'dbdriver' => 'postgre'
 	),
 
 	// Database configuration with failover
@@ -28,7 +28,7 @@
 				'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
index 755ce2a..d37ee48 100644
--- a/tests/mocks/database/config/sqlite.php
+++ b/tests/mocks/database/config/sqlite.php
@@ -9,7 +9,7 @@
 		'username' => 'sqlite',
 		'password' => 'sqlite',
 		'database' => realpath(__DIR__.'/..').'/ci_test.sqlite',
-		'dbdriver' => 'sqlite3',
+		'dbdriver' => 'sqlite3'
 	),
 
 	// Database configuration with failover
@@ -27,8 +27,8 @@
 				'username' => 'sqlite',
 				'password' => 'sqlite',
 				'database' => realpath(__DIR__.'/..').'/ci_test.sqlite',
-				'dbdriver' => 'sqlite3',
-			),
-		),
-	),
+				'dbdriver' => 'sqlite3'
+			)
+		)
+	)
 );
\ No newline at end of file
diff --git a/tests/mocks/database/db.php b/tests/mocks/database/db.php
index 59028ed..30504bb 100644
--- a/tests/mocks/database/db.php
+++ b/tests/mocks/database/db.php
@@ -6,7 +6,7 @@
 	 * @var array DB configuration
 	 */
 	private $config = array();
-	
+
 	/**
 	 * Prepare database configuration skeleton
 	 *
@@ -21,7 +21,7 @@
 	/**
 	 * Build DSN connection string for DB driver instantiate process
 	 *
-	 * @param 	string 	Group name 		
+	 * @param 	string 	Group name
 	 * @return 	string 	DSN Connection string
 	 */
 	public function set_dsn($group = 'default')
@@ -65,28 +65,27 @@
 	 * Return a database config array
 	 *
 	 * @see 	./config
-	 * @param 	string 		Driver based configuration
-	 * @return 	array 		
+	 * @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 		
+	 * @param 	string	Group or DSN string
+	 * @param 	bool
+	 * @return 	object
 	 */
 	public static function DB($group, $query_builder = FALSE)
 	{
 		include_once(BASEPATH.'database/DB.php');
 
-		try 
+		try
 		{
 			$db = DB($group, $query_builder);
 		}
@@ -97,4 +96,5 @@
 
 		return $db;
 	}
+
 }
\ No newline at end of file
diff --git a/tests/mocks/database/db/driver.php b/tests/mocks/database/db/driver.php
index cb18202..65ac2c4 100644
--- a/tests/mocks/database/db/driver.php
+++ b/tests/mocks/database/db/driver.php
@@ -1,7 +1,7 @@
 <?php
 
 class Mock_Database_DB_Driver extends CI_DB_driver {
-	
+
 	/**
 	 * @var object The actual Driver
 	 */
@@ -16,7 +16,10 @@
 	 */
 	public function __construct($driver_class, $config = array())
 	{
-		if (is_string($driver_class)) $this->ci_db_driver = new $driver_class($config);
+		if (is_string($driver_class))
+		{
+			$this->ci_db_driver = new $driver_class($config);
+		}
 	}
 
 	/**
diff --git a/tests/mocks/database/db/querybuilder.php b/tests/mocks/database/db/querybuilder.php
index 1b95c92..3f22526 100644
--- a/tests/mocks/database/db/querybuilder.php
+++ b/tests/mocks/database/db/querybuilder.php
@@ -1,10 +1,3 @@
 <?php
 
-if ( ! class_exists('CI_DB_query_builder'))
-{
-	class Mock_Database_DB_QueryBuilder extends CI_DB_active_record {}
-}
-else
-{
-	class Mock_Database_DB_QueryBuilder extends CI_DB_query_builder {}
-}
+class Mock_Database_DB_QueryBuilder extends CI_DB_query_builder {}
\ No newline at end of file
diff --git a/tests/mocks/database/drivers/mysql.php b/tests/mocks/database/drivers/mysql.php
index 34a74e2..e0c1fb0 100644
--- a/tests/mocks/database/drivers/mysql.php
+++ b/tests/mocks/database/drivers/mysql.php
@@ -1,16 +1,17 @@
 <?php
 
 class Mock_Database_Drivers_Mysql extends Mock_Database_DB_Driver {
-	
+
 	/**
 	 * Instantiate the database driver
 	 *
-	 * @param  string 	DB Driver class name
-	 * @param  array 	DB configuration to set
-	 * @return void
+	 * @param	string	DB Driver class name
+	 * @param	array	DB configuration to set
+	 * @return	void
 	 */
 	public function __construct($config = array())
 	{
 		parent::__construct('CI_DB_mysql_driver', $config);
 	}
+
 }
\ No newline at end of file
diff --git a/tests/mocks/database/drivers/pdo.php b/tests/mocks/database/drivers/pdo.php
index 590e195..17768ee 100644
--- a/tests/mocks/database/drivers/pdo.php
+++ b/tests/mocks/database/drivers/pdo.php
@@ -1,13 +1,13 @@
 <?php
 
 class Mock_Database_Drivers_PDO extends Mock_Database_DB_Driver {
-	
+
 	/**
 	 * Instantiate the database driver
 	 *
-	 * @param  string 	DB Driver class name
-	 * @param  array 	DB configuration to set
-	 * @return void
+	 * @param	string	DB Driver class name
+	 * @param	array	DB configuration to set
+	 * @return	void
 	 */
 	public function __construct($config = array())
 	{
diff --git a/tests/mocks/database/drivers/postgre.php b/tests/mocks/database/drivers/postgre.php
index 0df9059..5a45115 100644
--- a/tests/mocks/database/drivers/postgre.php
+++ b/tests/mocks/database/drivers/postgre.php
@@ -1,16 +1,17 @@
 <?php
 
 class Mock_Database_Drivers_Postgre extends Mock_Database_DB_Driver {
-	
+
 	/**
 	 * Instantiate the database driver
 	 *
-	 * @param  string 	DB Driver class name
-	 * @param  array 	DB configuration to set
-	 * @return void
+	 * @param	string	DB Driver class name
+	 * @param	array	DB configuration to set
+	 * @return	void
 	 */
 	public function __construct($config = array())
 	{
 		parent::__construct('CI_DB_postgre_driver', $config);
 	}
+
 }
\ No newline at end of file
diff --git a/tests/mocks/database/drivers/sqlite.php b/tests/mocks/database/drivers/sqlite.php
index 15cefbf..5124675 100644
--- a/tests/mocks/database/drivers/sqlite.php
+++ b/tests/mocks/database/drivers/sqlite.php
@@ -5,12 +5,13 @@
 	/**
 	 * Instantiate the database driver
 	 *
-	 * @param  string 	DB Driver class name
-	 * @param  array 	DB configuration to set
-	 * @return void
+	 * @param	string	DB Driver class name
+	 * @param	array	DB configuration to set
+	 * @return	void
 	 */
 	public function __construct($config = array())
 	{
 		parent::__construct('CI_DB_sqlite3_driver', $config);
 	}
+
 }
\ No newline at end of file
diff --git a/tests/mocks/database/schema/skeleton.php b/tests/mocks/database/schema/skeleton.php
index 05499f8..18e1ddd 100644
--- a/tests/mocks/database/schema/skeleton.php
+++ b/tests/mocks/database/schema/skeleton.php
@@ -41,8 +41,7 @@
 
 		return static::$db;
 	}
-	
-	
+
 	/**
 	 * Create the dummy tables
 	 *
@@ -54,20 +53,20 @@
 		static::$forge->add_field(array(
 			'id' => array(
 				'type' => 'INTEGER',
-				'constraint' => 3,
+				'constraint' => 3
 			),
 			'name' => array(
 				'type' => 'VARCHAR',
-				'constraint' => 40,
+				'constraint' => 40
 			),
 			'email' => array(
 				'type' => 'VARCHAR',
-				'constraint' => 100,
+				'constraint' => 100
 			),
 			'country' => array(
 				'type' => 'VARCHAR',
-				'constraint' => 40,
-			),
+				'constraint' => 40
+			)
 		));
 		static::$forge->add_key('id', TRUE);
 		static::$forge->create_table('user', (strpos(static::$driver, 'pgsql') === FALSE));
@@ -76,15 +75,15 @@
 		static::$forge->add_field(array(
 			'id' => array(
 				'type' => 'INTEGER',
-				'constraint' => 3,
+				'constraint' => 3
 			),
 			'name' => array(
 				'type' => 'VARCHAR',
-				'constraint' => 40,
+				'constraint' => 40
 			),
 			'description' => array(
-				'type' => 'TEXT',
-			),
+				'type' => 'TEXT'
+			)
 		));
 		static::$forge->add_key('id', TRUE);
 		static::$forge->create_table('job', (strpos(static::$driver, 'pgsql') === FALSE));
@@ -93,15 +92,15 @@
 		static::$forge->add_field(array(
 			'id' => array(
 				'type' => 'INTEGER',
-				'constraint' => 3,
+				'constraint' => 3
 			),
 			'key' => array(
 				'type' => 'VARCHAR',
-				'constraint' => 40,
+				'constraint' => 40
 			),
 			'value' => array(
-				'type' => 'TEXT',
-			),
+				'type' => 'TEXT'
+			)
 		));
 		static::$forge->add_key('id', TRUE);
 		static::$forge->create_table('misc', (strpos(static::$driver, 'pgsql') === FALSE));
@@ -120,28 +119,29 @@
 				array('id' => 1, 'name' => 'Derek Jones', 'email' => 'derek@world.com', 'country' => 'US'),
 				array('id' => 2, 'name' => 'Ahmadinejad', 'email' => 'ahmadinejad@world.com', 'country' => 'Iran'),
 				array('id' => 3, 'name' => 'Richard A Causey', 'email' => 'richard@world.com', 'country' => 'US'),
-				array('id' => 4, 'name' => 'Chris Martin', 'email' => 'chris@world.com', 'country' => 'UK'),
+				array('id' => 4, 'name' => 'Chris Martin', 'email' => 'chris@world.com', 'country' => 'UK')
 			),
 			'job' => array(
-				array('id' => 1, 'name' => 'Developer', 'description' => 'Awesome job, but sometimes makes you bored'), 
+				array('id' => 1, 'name' => 'Developer', 'description' => 'Awesome job, but sometimes makes you bored'),
 				array('id' => 2, 'name' => 'Politician', 'description' => 'This is not really a job'),
-    			array('id' => 3, 'name' => 'Accountant', 'description' => 'Boring job, but you will get free snack at lunch'),
-			    array('id' => 4, 'name' => 'Musician', 'description' => 'Only Coldplay can actually called Musician'),
+    				array('id' => 3, 'name' => 'Accountant', 'description' => 'Boring job, but you will get free snack at lunch'),
+				array('id' => 4, 'name' => 'Musician', 'description' => 'Only Coldplay can actually called Musician')
 			),
 			'misc' => array(
-				array('id' => 1, 'key' => '\\xxxfoo456', 'value' => 'Entry with \\xxx'), 
-				array('id' => 2, 'key' => '\\%foo456', 'value' => 'Entry with \\%'),
-			),
+				array('id' => 1, 'key' => '\\xxxfoo456', 'value' => 'Entry with \\xxx'),
+				array('id' => 2, 'key' => '\\%foo456', 'value' => 'Entry with \\%')
+			)
 		);
 
-		foreach ($data as $table => $dummy_data) 
+		foreach ($data as $table => $dummy_data)
 		{
 			static::$db->truncate($table);
 
 			foreach ($dummy_data as $single_dummy_data)
 			{
-				static::$db->insert($table, $single_dummy_data); 
+				static::$db->insert($table, $single_dummy_data);
 			}
 		}
 	}
+
 }
\ No newline at end of file