diff --git a/sys/databases/firebird-ibase.php b/sys/databases/firebird-ibase.php index c433fcd..5c828a4 100644 --- a/sys/databases/firebird-ibase.php +++ b/sys/databases/firebird-ibase.php @@ -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; diff --git a/tests/databases/firebird.php b/tests/databases/firebird.php index ad0c2ec..61d3cda 100644 --- a/tests/databases/firebird.php +++ b/tests/databases/firebird.php @@ -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(); } diff --git a/tests/index.php b/tests/index.php index 35b9386..40f3e6d 100644 --- a/tests/index.php +++ b/tests/index.php @@ -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