summaryrefslogtreecommitdiffstats
path: root/tests/codeigniter/database/DB_driver_test.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/codeigniter/database/DB_driver_test.php')
-rw-r--r--tests/codeigniter/database/DB_driver_test.php39
1 files changed, 39 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..c04c42b09
--- /dev/null
+++ b/tests/codeigniter/database/DB_driver_test.php
@@ -0,0 +1,39 @@
+<?php
+
+class DB_driver_test extends CI_TestCase {
+
+ public function test_initialize()
+ {
+ $config = Mock_Database_DB::config(DB_DRIVER);
+ sscanf(DB_DRIVER, '%[^/]/', $driver_name);
+ $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 mysqli($config)
+ {
+ return new Mock_Database_Drivers_Mysqli($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