Firebird driver now throws PDOException

This commit is contained in:
Timothy Warren 2012-03-06 21:32:49 -05:00
parent 83e949d7f2
commit d555412826
3 changed files with 12 additions and 2 deletions

View File

@ -34,7 +34,13 @@ class firebird extends DB_PDO {
// pass around the resource that this provides.
// Since the resource is not required by the
// functions that would use it, I'm dumping it.
ibase_connect($dbpath, $user, $pass, 'utf-8');
$conn = @ibase_connect($dbpath, $user, $pass, 'utf-8');
if ( ! is_resource($conn))
{
throw new PDOException(ibase_errmsg());
die();
}
$class = __CLASS__."_sql";
$this->sql = new $class;

View File

@ -32,7 +32,9 @@ class FirebirdTest extends UnitTestCase {
function setUp()
{
$this->db = new Firebird(dirname(__FILE__)."/../test_dbs/FB_TEST_DB.FDB");
$dbpath = TEST_DIR.DS.'test_dbs'.DS.'FB_TEST_DB.FDB';
echo "\n\n{$dbpath}\n\n";
$this->db = new Firebird($dbpath);
$this->tables = $this->db->get_tables();
}

View File

@ -16,6 +16,8 @@
* Unit test bootstrap - Using php simpletest
*/
define('BASE_DIR', '../src');
define('TEST_DIR', dirname(__FILE__));
define('DS', DIRECTORY_SEPARATOR);
// Include simpletest
// it has to be set in your php path, or put in the tests folder