aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_framework
diff options
context:
space:
mode:
authorTristan Darricau <github@nicofuma.fr>2014-06-29 21:58:17 +0200
committerTristan Darricau <github@nicofuma.fr>2014-07-07 01:02:40 +0200
commited812a9dfb59b1eb83263adbaa52723ff826a791 (patch)
treec75d2136fa2486fb994dbddb8b7fa88401237e44 /tests/test_framework
parent98e8be966bd8174c2a3f4e8fb80167b23573441f (diff)
downloadforums-ed812a9dfb59b1eb83263adbaa52723ff826a791.tar
forums-ed812a9dfb59b1eb83263adbaa52723ff826a791.tar.gz
forums-ed812a9dfb59b1eb83263adbaa52723ff826a791.tar.bz2
forums-ed812a9dfb59b1eb83263adbaa52723ff826a791.tar.xz
forums-ed812a9dfb59b1eb83263adbaa52723ff826a791.zip
[ticket/12775] Move phpbb_convert_30_dbms_to_31 into the config file class
PHPBB3-12775
Diffstat (limited to 'tests/test_framework')
-rw-r--r--tests/test_framework/phpbb_test_case_helpers.php20
1 files changed, 7 insertions, 13 deletions
diff --git a/tests/test_framework/phpbb_test_case_helpers.php b/tests/test_framework/phpbb_test_case_helpers.php
index a29b6e1955..ade1bf6e23 100644
--- a/tests/test_framework/phpbb_test_case_helpers.php
+++ b/tests/test_framework/phpbb_test_case_helpers.php
@@ -142,17 +142,16 @@ class phpbb_test_case_helpers
$test_config = dirname(__FILE__) . '/../test_config.php';
}
+ $config_php_file = new \phpbb\config_php_file('', '');
+
if (file_exists($test_config))
{
- include($test_config);
-
- if (!function_exists('phpbb_convert_30_dbms_to_31'))
- {
- require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
- }
+ $config_php_file->set_config_file($test_config);
+ extract($config_php_file->get_all());
+ unset($dbpasswd);
$config = array_merge($config, array(
- 'dbms' => phpbb_convert_30_dbms_to_31($dbms),
+ 'dbms' => $config_php_file->convert_30_dbms_to_31($dbms),
'dbhost' => $dbhost,
'dbport' => $dbport,
'dbname' => $dbname,
@@ -183,13 +182,8 @@ class phpbb_test_case_helpers
if (isset($_SERVER['PHPBB_TEST_DBMS']))
{
- if (!function_exists('phpbb_convert_30_dbms_to_31'))
- {
- require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
- }
-
$config = array_merge($config, array(
- 'dbms' => isset($_SERVER['PHPBB_TEST_DBMS']) ? phpbb_convert_30_dbms_to_31($_SERVER['PHPBB_TEST_DBMS']) : '',
+ 'dbms' => isset($_SERVER['PHPBB_TEST_DBMS']) ? $config_php_file->convert_30_dbms_to_31($_SERVER['PHPBB_TEST_DBMS']) : '',
'dbhost' => isset($_SERVER['PHPBB_TEST_DBHOST']) ? $_SERVER['PHPBB_TEST_DBHOST'] : '',
'dbport' => isset($_SERVER['PHPBB_TEST_DBPORT']) ? $_SERVER['PHPBB_TEST_DBPORT'] : '',
'dbname' => isset($_SERVER['PHPBB_TEST_DBNAME']) ? $_SERVER['PHPBB_TEST_DBNAME'] : '',