Fix Firebird loading issue for tests

This commit is contained in:
Timothy Warren 2014-02-14 22:52:56 -05:00
parent fabedc1d7f
commit a443bbc86d
2 changed files with 14 additions and 2 deletions

View File

@ -85,7 +85,14 @@ require_once(QTEST_DIR . '/core/db_test.php');
require_once(QTEST_DIR . '/core/db_qp_test.php');
require_once(QTEST_DIR . '/core/db_qb_test.php');
// Load firebird classes for testing
array_map('do_include', glob(QDRIVER_PATH.'/firebird/*.php'));
// If Firebird (interbase) extension does not exist,
// create a fake class to suppress errors from skipped tests
if ( ! function_exists('fbird_connect'))
{
class Firebird {
public $sql;
public $util;
}
}
// End of bootstrap.php

View File

@ -25,6 +25,11 @@ class FirebirdTest extends DBtest {
{
$dbpath = QTEST_DIR.QDS.'db_files'.QDS.'FB_TEST_DB.FDB';
if ( ! function_exists('fbird_connect'))
{
$this->markTestSkipped('Firebird extension does not exist');
}
// test the db driver directly
$this->db = new Firebird('localhost:'.$dbpath);
$this->tables = $this->db->get_tables();