diff options
author | Andrey Andreev <narf@devilix.net> | 2015-02-19 14:24:58 +0100 |
---|---|---|
committer | Andrey Andreev <narf@devilix.net> | 2015-02-19 14:24:58 +0100 |
commit | 8b4886d42055569d974feddb44a6d355d0f9171b (patch) | |
tree | 5958cab9bc2032df238e17cc64e618a18871d862 /tests | |
parent | 54fb6f68f1d793b9582dae455b2022e2ecfd3247 (diff) |
test_db_invalid fails too
Diffstat (limited to 'tests')
-rw-r--r-- | tests/codeigniter/database/DB_test.php | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/tests/codeigniter/database/DB_test.php b/tests/codeigniter/database/DB_test.php index 0c3df3fc4..546d5fab9 100644 --- a/tests/codeigniter/database/DB_test.php +++ b/tests/codeigniter/database/DB_test.php @@ -2,6 +2,9 @@ class DB_test extends CI_TestCase { + /** + * @expectedException InvalidArgumentException + */ public function test_db_invalid() { $connection = new Mock_Database_DB(array( @@ -34,17 +37,20 @@ class DB_test extends CI_TestCase { // ------------------------------------------------------------------------ - /** - * @expectedException RuntimeException - */ public function test_db_failover() { $config = Mock_Database_DB::config(DB_DRIVER); $connection = new Mock_Database_DB($config); - $db = Mock_Database_DB::DB($connection->set_dsn(DB_DRIVER.'_failover'), TRUE); - $this->assertTrue($db instanceof CI_DB); - $this->assertTrue($db instanceof CI_DB_Driver); + try + { + $db = Mock_Database_DB::DB($connection->set_dsn(DB_DRIVER.'_failover'), TRUE); + } + catch (RuntimeException $e) + { + $this->assertTrue($db instanceof CI_DB); + $this->assertTrue($db instanceof CI_DB_Driver); + } } }
\ No newline at end of file |