Minor tweaks to exceptions
This commit is contained in:
parent
d9a4b5fbe5
commit
9d8d07958f
@ -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
|
||||
|
@ -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
|
Binary file not shown.
Loading…
Reference in New Issue
Block a user