From 8b4886d42055569d974feddb44a6d355d0f9171b Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Thu, 19 Feb 2015 15:24:58 +0200 Subject: test_db_invalid fails too --- tests/codeigniter/database/DB_test.php | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'tests/codeigniter') 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 -- cgit v1.2.3-24-g4f1b