aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_framework
diff options
context:
space:
mode:
authorAndreas Fischer <bantu@phpbb.com>2014-07-11 11:49:51 +0200
committerAndreas Fischer <bantu@phpbb.com>2014-07-11 11:49:51 +0200
commitb2a883d504d9ece8525fcc1a4aa8e44a000db6ca (patch)
tree81a85d5242913fa7e667b5adc873bd4a500ed406 /tests/test_framework
parent147b942e5c885f13181f0cb4d67cb4ccee4652df (diff)
parent58a52fe5b90215d090ba3b992f96d401d805440c (diff)
downloadforums-b2a883d504d9ece8525fcc1a4aa8e44a000db6ca.tar
forums-b2a883d504d9ece8525fcc1a4aa8e44a000db6ca.tar.gz
forums-b2a883d504d9ece8525fcc1a4aa8e44a000db6ca.tar.bz2
forums-b2a883d504d9ece8525fcc1a4aa8e44a000db6ca.tar.xz
forums-b2a883d504d9ece8525fcc1a4aa8e44a000db6ca.zip
Merge pull request #2671 from Nicofuma/ticket/12775
[ticket/12775] Replace functions_container with a container_builder class. * Nicofuma/ticket/12775: (34 commits) [ticket/12775] Set dbal.conn.driver as synthetic during installation [ticket/12775] Add the definition of dbal.conn in fixtures/config/services.yml [ticket/12775] Inject the connection when created in the container [ticket/12775] Extract the vars later in install/install_update.php [ticket/12775] Rename config_php_handler to config_php_file container_builder [ticket/12775] Set defined_vars as a property of config_php_file [ticket/12775] Fix doc blocks in the container builder [ticket/12775] Remove useless includes of config.php [ticket/12775] Move phpbb_convert_30_dbms_to_31 into the config file class [ticket/12775] Fix comments [ticket/12775] Update doc blocks [ticket/12775] Fix container_builder [ticket/12775] Rename config_php to config_php_file [ticket/12775] Renamed to \phpbb\di\container_builder [ticket/12775] Remove the last include of functions_container [ticket/12775] Fix unit tests [ticket/12775] Add tests for \phpbb\config_php [ticket/12775] Add tests for the container factory [ticket/12775] Use a field instead of a local var in load_config_var() [ticket/12775] Update container and config in install/ ...
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'] : '',