From a443bbc86d70dd939c9e36144529e9e84456ee2a Mon Sep 17 00:00:00 2001 From: "Timothy J. Warren" Date: Fri, 14 Feb 2014 22:52:56 -0500 Subject: [PATCH] Fix Firebird loading issue for tests --- tests/bootstrap.php | 11 +++++++++-- tests/databases/firebird/FirebirdTest.php | 5 +++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/tests/bootstrap.php b/tests/bootstrap.php index 339071f..060f23c 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -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 \ No newline at end of file diff --git a/tests/databases/firebird/FirebirdTest.php b/tests/databases/firebird/FirebirdTest.php index 76913e7..518dc10 100644 --- a/tests/databases/firebird/FirebirdTest.php +++ b/tests/databases/firebird/FirebirdTest.php @@ -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();