summaryrefslogtreecommitdiffstats
path: root/tests/codeigniter/database/DB_driver_test.php
diff options
context:
space:
mode:
authorTimothy Warren <tim@timshomepage.net>2012-04-26 23:58:56 +0200
committerTimothy Warren <tim@timshomepage.net>2012-04-26 23:58:56 +0200
commit042766bac61958a21ba5d6b3c53b0e4296fdcce7 (patch)
treedf9e26699ddb5d3841a0d1cc1795913c819bf611 /tests/codeigniter/database/DB_driver_test.php
parent0688ac9ad88a03f1c56cfcd9e3c475b83301344d (diff)
parent61318a2c53c13a314f483fcbbfd64c6e01f5242c (diff)
Merge branch 'develop' of git://github.com/EllisLab/CodeIgniter into library-cleanup
Diffstat (limited to 'tests/codeigniter/database/DB_driver_test.php')
-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