diff options
author | Taufan Aditya <toopay@taufanaditya.com> | 2012-03-28 22:00:56 +0200 |
---|---|---|
committer | Taufan Aditya <toopay@taufanaditya.com> | 2012-03-28 22:00:56 +0200 |
commit | 655a89f4059ebae017d1c4ec5f26aeb2cf4a3bae (patch) | |
tree | fe33f2f905631133d4d9807ef0f75d8d14618392 /tests/codeigniter/database | |
parent | 3b2587e1559d2cbe751d04f801f999ef3fa4e74c (diff) |
Preliminary Database Test
Diffstat (limited to 'tests/codeigniter/database')
-rw-r--r-- | tests/codeigniter/database/.gitkeep | 0 | ||||
-rw-r--r-- | tests/codeigniter/database/DB_test.php | 44 |
2 files changed, 44 insertions, 0 deletions
diff --git a/tests/codeigniter/database/.gitkeep b/tests/codeigniter/database/.gitkeep deleted file mode 100644 index e69de29bb..000000000 --- a/tests/codeigniter/database/.gitkeep +++ /dev/null diff --git a/tests/codeigniter/database/DB_test.php b/tests/codeigniter/database/DB_test.php new file mode 100644 index 000000000..c1930f5f2 --- /dev/null +++ b/tests/codeigniter/database/DB_test.php @@ -0,0 +1,44 @@ +<?php + +class DB_test extends CI_TestCase { + + public $db_config; + + public function set_up() + { + $this->db_config = new Mock_Database_DB(array( + 'mysql' => array( + 'dsn' => '', + 'hostname' => 'localhost', + 'username' => 'travis', + 'password' => '', + 'database' => 'ci_test', + 'dbdriver' => 'mysql', + 'dbprefix' => '', + 'pconnect' => FALSE, + 'db_debug' => TRUE, + 'cache_on' => FALSE, + 'cachedir' => '', + 'char_set' => 'utf8', + 'dbcollat' => 'utf8_general_ci', + 'swap_pre' => '', + 'autoinit' => TRUE, + 'stricton' => FALSE, + 'failover' => array(), + ), + )); + } + + // ------------------------------------------------------------------------ + + public function test_db_valid() + { + $db = DB($this->db_config->set_config('mysql'), TRUE); + + $this->assertTrue($db instanceof CI_DB); + $this->assertTrue($db instanceof CI_DB_Driver); + $this->assertTrue($db instanceof CI_DB_active_record); + $this->assertTrue($db instanceof CI_DB_mysql_driver); + } + +}
\ No newline at end of file |