summaryrefslogtreecommitdiffstats
path: root/tests/codeigniter
diff options
context:
space:
mode:
authorTaufan Aditya <toopay@taufanaditya.com>2012-04-04 18:24:09 +0200
committerTaufan Aditya <toopay@taufanaditya.com>2012-04-04 18:24:09 +0200
commitf4c6c9b3061b464c959b6409f962228959f35287 (patch)
tree2e277194428bdbeb5a515817bbc35ad3bb6dc95f /tests/codeigniter
parent44015c8d91ecea78ee4a10de579c36a859c2fcb6 (diff)
DB Drivers test
Diffstat (limited to 'tests/codeigniter')
-rw-r--r--tests/codeigniter/database/DB_driver_test.php36
1 files changed, 36 insertions, 0 deletions
diff --git a/tests/codeigniter/database/DB_driver_test.php b/tests/codeigniter/database/DB_driver_test.php
new file mode 100644
index 000000000..fb40f0608
--- /dev/null
+++ b/tests/codeigniter/database/DB_driver_test.php
@@ -0,0 +1,36 @@
+<?php
+
+class DB_driver_test extends CI_TestCase {
+
+ // ------------------------------------------------------------------------
+
+ public function test_initialize()
+ {
+ $config = Mock_Database_DB::config(DB_DRIVER);
+ $driver_name = current(explode('/', DB_DRIVER));
+ $driver = $this->$driver_name($config[DB_DRIVER]);
+
+ $this->assertTrue($driver->initialize());
+ }
+
+ protected function pdo($config)
+ {
+ return new Mock_Database_Drivers_PDO($config);
+ }
+
+ protected function mysql($config)
+ {
+ return new Mock_Database_Drivers_Mysql($config);
+ }
+
+ protected function sqlite($config)
+ {
+ return new Mock_Database_Drivers_Sqlite($config);
+ }
+
+ protected function pgsql($config)
+ {
+ return new Mock_Database_Drivers_Postgre($config);
+ }
+
+} \ No newline at end of file