diff --git a/composer.json b/composer.json index c2fabf0..22f20e4 100644 --- a/composer.json +++ b/composer.json @@ -20,7 +20,7 @@ "role": "Developer" }], "require-dev": { - "phpunit/php-code-coverage": ">=1.2.10,<1.3.0", + "phpunit/php-code-coverage": ">=1.2.10,<1.3.0" }, "require": { "php": ">=5.2.0" diff --git a/tests/core/db_qb_test.php b/tests/core/db_qb_test.php index 97e3f0b..2f4d45f 100644 --- a/tests/core/db_qb_test.php +++ b/tests/core/db_qb_test.php @@ -793,11 +793,11 @@ abstract class QBTest extends UnitTestCase { public function TestGetCompiledSelect() { - $sql = $this->db->from('create_test')->get_compled_select('', FALSE); - $qb_res = $this->db->get(); + $sql = $this->db->get_compiled_select('create_test'); + $qb_res = $this->db->get('create_test'); $sql_res = $this->db->query($sql); - $this->assertEqual($qb_res, $sql_res); + $this->assertClone($qb_res, $sql_res); } // -------------------------------------------------------------------------- diff --git a/tests/databases/firebird/firebird-qb.php b/tests/databases/firebird/firebird-qb.php index 201daa7..90af362 100644 --- a/tests/databases/firebird/firebird-qb.php +++ b/tests/databases/firebird/firebird-qb.php @@ -39,6 +39,16 @@ class FirebirdQBTest extends QBTest { } // -------------------------------------------------------------------------- + + public function TestGetCompiledSelect() + { + $sql = $this->db->get_compiled_select('create_test'); + $qb_res = $this->db->get('create_test'); + $sql_res = $this->db->query($sql); + + $this->assertIsA($qb_res, 'Firebird_Result'); + $this->assertIsA($sql_res, 'Firebird_Result'); + } public function TestInsertBatch() { diff --git a/tests/db_files/FB_TEST_DB.FDB b/tests/db_files/FB_TEST_DB.FDB index 223e0c7..a04a817 100755 Binary files a/tests/db_files/FB_TEST_DB.FDB and b/tests/db_files/FB_TEST_DB.FDB differ diff --git a/tests/index.php b/tests/index.php index 205c515..a5905c3 100644 --- a/tests/index.php +++ b/tests/index.php @@ -21,9 +21,15 @@ define('QBASE_DIR', str_replace(basename(QTEST_DIR), '', QTEST_DIR)); define('QDS', DIRECTORY_SEPARATOR); // Include simpletest -// it has to be set in your php path, or put in the tests folder +// it has to be in the tests folder require_once('simpletest/autorun.php'); +// Require composer items, if they exist +if (is_dir(QBASE_DIR.'/vendor/')) +{ + require_once(QBASE_DIR.'/vendor/autoload.php'); +} + // Include db classes require_once(QBASE_DIR . 'autoload.php'); diff --git a/tests/simpletest/autorun.php b/tests/simpletest/autorun.php index 9145417..4a6c2d9 100644 --- a/tests/simpletest/autorun.php +++ b/tests/simpletest/autorun.php @@ -51,12 +51,12 @@ function run_local_tests() { $suite = $loader->createSuiteFromClasses( basename(initial_file()), $loader->selectRunnableTests($candidates)); - if (function_exists("xdebug_start_code_coverage")) { + if (function_exists("xdebug_start_code_coverage") && is_dir(QBASE_DIR.'/vendor/')) { $coverage = new PHP_CodeCoverage; $coverage->start('Query'); } $ret = $suite->run(new DefaultReporter()); - if (function_exists("xdebug_start_code_coverage")) { + if (function_exists("xdebug_start_code_coverage") && is_dir(QBASE_DIR.'/vendor/')) { $coverage->stop(); $writer = new PHP_CodeCoverage_Report_HTML; $writer->process($coverage, QBASE_DIR . '/coverage/');