diff options
author | Phil Sturgeon <email@philsturgeon.co.uk> | 2012-04-26 20:27:02 +0200 |
---|---|---|
committer | Phil Sturgeon <email@philsturgeon.co.uk> | 2012-04-26 20:27:02 +0200 |
commit | 0713b94f5245c9180b58207b661155f084fb493b (patch) | |
tree | e269a5f722e2c129357252ee0e8e649f1588d7e4 /tests/codeigniter/database/DB_driver_test.php | |
parent | 9e2d5d130eff40592b49337a8ba4d8c170934de1 (diff) | |
parent | d115f8327a8f16d957cc4e0876225037bb2f5868 (diff) |
Merge pull request #1246 from toopay/db-tests
Improved test coverage for Database.
Diffstat (limited to 'tests/codeigniter/database/DB_driver_test.php')
-rw-r--r-- | tests/codeigniter/database/DB_driver_test.php | 36 |
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 |