summaryrefslogtreecommitdiffstats
path: root/tests/codeigniter/database/DB_driver_test.php
diff options
context:
space:
mode:
authorAndrey Andreev <narf@bofh.bg>2012-04-27 11:18:26 +0200
committerAndrey Andreev <narf@bofh.bg>2012-04-27 11:18:26 +0200
commit1fcce9667fe8d1925a36549e22124411f5828230 (patch)
tree56e5cb2c50831a50b7c79ea216645846ea59e8ab /tests/codeigniter/database/DB_driver_test.php
parentb8949fab60082e17f219fc89c6c8a85d3ff73f19 (diff)
parentced2c9ab41450cb632c042730604111ec2a24e1f (diff)
Merge branch 'develop' of github.com:EllisLab/CodeIgniter into develop-db-mssql
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