aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Fischer <bantu@phpbb.com>2010-04-02 00:35:48 +0200
committerNils Adermann <naderman@naderman.de>2010-04-02 18:28:06 +0200
commite9de68f9a33b34653efe75219afcd0923a09df64 (patch)
tree8269ac4cbe7ee3858f5c1c06788ffcf7356a0270
parent2bbfa9c29f4ce33d25e58c550540e236a4ee3c1a (diff)
downloadforums-e9de68f9a33b34653efe75219afcd0923a09df64.tar
forums-e9de68f9a33b34653efe75219afcd0923a09df64.tar.gz
forums-e9de68f9a33b34653efe75219afcd0923a09df64.tar.bz2
forums-e9de68f9a33b34653efe75219afcd0923a09df64.tar.xz
forums-e9de68f9a33b34653efe75219afcd0923a09df64.zip
[feature/dbal-tests] Fix mysql (not mysqli) dbal test.
Correctly determine MySQL version from the database.
-rw-r--r--tests/test_framework/phpbb_database_test_case.php6
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/test_framework/phpbb_database_test_case.php b/tests/test_framework/phpbb_database_test_case.php
index a80f03b749..d2ebe4c30e 100644
--- a/tests/test_framework/phpbb_database_test_case.php
+++ b/tests/test_framework/phpbb_database_test_case.php
@@ -126,8 +126,9 @@ abstract class phpbb_database_test_case extends PHPUnit_Extensions_Database_Test
if ($database_config['dbms'] == 'mysql')
{
- $pdo->exec('SELECT VERSION() AS version');
+ $sth = $pdo->query('SELECT VERSION() AS version');
$row = $sth->fetch(PDO::FETCH_ASSOC);
+
if (version_compare($row['version'], '4.1.3', '>='))
{
$dbms_data['SCHEMA'] .= '_41';
@@ -136,7 +137,8 @@ abstract class phpbb_database_test_case extends PHPUnit_Extensions_Database_Test
{
$dbms_data['SCHEMA'] .= '_40';
}
- unset($row);
+
+ unset($row, $sth);
}
$sql_query = $this->split_sql_file(file_get_contents("../phpBB/install/schemas/{$dbms_data['SCHEMA']}_schema.sql"), $dbms_data['DELIM']);