diff --git a/classes/query_builder.php b/classes/query_builder.php index d9a22e4..1ea52d5 100644 --- a/classes/query_builder.php +++ b/classes/query_builder.php @@ -254,7 +254,7 @@ class Query_Builder { } catch(Exception $e) { - throw new BadConnectionException('Connection failed, invalid arguments'); + throw new BadConnectionException('Connection failed, invalid arguments', 2, $e); } // Set the connection name property, if applicable diff --git a/tests/core/db_qb_test.php b/tests/core/db_qb_test.php index 55279ce..c0d9ca1 100644 --- a/tests/core/db_qb_test.php +++ b/tests/core/db_qb_test.php @@ -426,7 +426,7 @@ abstract class QBTest extends UnitTestCase { } // -------------------------------------------------------------------------- - // ! Other Tests + // ! Error Tests // -------------------------------------------------------------------------- /** @@ -448,6 +448,24 @@ abstract class QBTest extends UnitTestCase { $this->db = new Query_Builder($params); } + // -------------------------------------------------------------------------- + + public function TestBadConnection() + { + $params = array( + 'host' => '127.0.0.1', + 'port' => '3306', + 'database' => 'test', + 'user' => NULL, + 'pass' => NULL, + 'type' => 'mysql' + ); + + $this->expectException('BadConnectionException'); + + $this->db = new Query_Builder($params); + + } } // End of db_qb_test.php \ No newline at end of file diff --git a/tests/db_files/FB_TEST_DB.FDB b/tests/db_files/FB_TEST_DB.FDB index 08cb9f1..7b5b0a6 100644 Binary files a/tests/db_files/FB_TEST_DB.FDB and b/tests/db_files/FB_TEST_DB.FDB differ