diff options
author | Ahmad Anbar <aanbar@gmail.com> | 2015-04-06 18:59:53 +0200 |
---|---|---|
committer | Ahmad Anbar <aanbar@gmail.com> | 2015-04-06 18:59:53 +0200 |
commit | 5e50c42ef27261bc7fcb279499ce76cfc2519aa6 (patch) | |
tree | d74d660534b72ddc0b6cda9147cecfb64a225346 /tests/codeigniter/database/DB_test.php | |
parent | ed520408514fff6486788e1543589418d24d885e (diff) | |
parent | 7726b75552f765af94038e47a4a4272ac08c646e (diff) |
Merge remote-tracking branch 'upstream/develop' into develop
Diffstat (limited to 'tests/codeigniter/database/DB_test.php')
-rw-r--r-- | tests/codeigniter/database/DB_test.php | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/tests/codeigniter/database/DB_test.php b/tests/codeigniter/database/DB_test.php index d5c0dea08..dc4fae986 100644 --- a/tests/codeigniter/database/DB_test.php +++ b/tests/codeigniter/database/DB_test.php @@ -15,7 +15,7 @@ class DB_test extends CI_TestCase { ), )); - $this->setExpectedException('InvalidArgumentException', 'CI Error: Invalid DB driver'); + $this->setExpectedException('RuntimeException', 'CI Error: Invalid DB driver'); Mock_Database_DB::DB($connection->set_dsn('undefined'), TRUE); } @@ -26,6 +26,14 @@ class DB_test extends CI_TestCase { { $config = Mock_Database_DB::config(DB_DRIVER); $connection = new Mock_Database_DB($config); + + // E_DEPRECATED notices thrown by mysql_connect(), mysql_pconnect() + // on PHP 5.5+ cause the tests to fail + if (DB_DRIVER === 'mysql' && version_compare(PHP_VERSION, '5.5', '>=')) + { + error_reporting(E_ALL & ~E_DEPRECATED); + } + $db = Mock_Database_DB::DB($connection->set_dsn(DB_DRIVER), TRUE); $this->assertTrue($db instanceof CI_DB); @@ -34,6 +42,11 @@ class DB_test extends CI_TestCase { // ------------------------------------------------------------------------ +/* + This test is unusable, because whoever wrote it apparently thought that + an E_WARNING should equal an Exception and based the whole test suite + around that bogus assumption. + public function test_db_failover() { $config = Mock_Database_DB::config(DB_DRIVER); @@ -43,5 +56,6 @@ class DB_test extends CI_TestCase { $this->assertTrue($db instanceof CI_DB); $this->assertTrue($db instanceof CI_DB_Driver); } +*/ }
\ No newline at end of file |