aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_framework/phpbb_test_case_helpers.php
diff options
context:
space:
mode:
authorIgor Wiedler <igor@wiedler.ch>2012-02-17 13:48:48 +0100
committerIgor Wiedler <igor@wiedler.ch>2012-02-17 13:48:48 +0100
commitd70c3f1eb8c0ddc68d8eda1bd8708c4957c21182 (patch)
treec0081f9deac588982d2e00cf935daabb03af6605 /tests/test_framework/phpbb_test_case_helpers.php
parent7295e5824aed6f5ec32cfab0ad17cfa2c24855ac (diff)
parent9611b5ff83582d7bda22ab991e8d69786dab5b93 (diff)
downloadforums-d70c3f1eb8c0ddc68d8eda1bd8708c4957c21182.tar
forums-d70c3f1eb8c0ddc68d8eda1bd8708c4957c21182.tar.gz
forums-d70c3f1eb8c0ddc68d8eda1bd8708c4957c21182.tar.bz2
forums-d70c3f1eb8c0ddc68d8eda1bd8708c4957c21182.tar.xz
forums-d70c3f1eb8c0ddc68d8eda1bd8708c4957c21182.zip
Merge branch 'develop' into ticket/10380
* develop: (325 commits) [ticket/10641] Update MCP template with new plurality forms [ticket/10637] Leftovers from implementation of extensions in convertor [ticket/10637] Leftovers from implementation of extensions in develop tools [ticket/10637] Leftovers from implementation of extensions in mcp_post [ticket/10637] Leftovers from implementation of extensions in mcp_main [ticket/10637] Leftovers from implementation of extensions [ticket/10606] Also correctly use $s_search_hidden_fields in view(forum|topic). [ticket/10606] Fix incorrect hidden fields array name in page_header(). [ticket/10633] Stop leaking filename of attachments when thumbnail is requested [ticket/10636] Resolve variable name ($sql_ary) conflict in cache_moderators(). [ticket/10634] Specify module type when viewing profile [ticket/10634] Changing p_master::is_full_class [ticket/10569] Invalid string comparison in prosilver [ticket/10495] Update request/type_cast_helper for PHP 5.4 magic_quotes_gpc drop [ticket/10512] Call startup.php from tests/bootstrap.php [ticket/10535] Delete no longer needed email confirm language entries. [ticket/9914] Add backup warning to updater. [ticket/10616] Add template inheritance to exported template [ticket/10616] Ignore template inheritance that points to self [ticket/10616] Add template inheritance to default styles ...
Diffstat (limited to 'tests/test_framework/phpbb_test_case_helpers.php')
-rw-r--r--tests/test_framework/phpbb_test_case_helpers.php59
1 files changed, 58 insertions, 1 deletions
diff --git a/tests/test_framework/phpbb_test_case_helpers.php b/tests/test_framework/phpbb_test_case_helpers.php
index 697dc93501..9c91778cb0 100644
--- a/tests/test_framework/phpbb_test_case_helpers.php
+++ b/tests/test_framework/phpbb_test_case_helpers.php
@@ -3,7 +3,7 @@
*
* @package testing
* @copyright (c) 2008 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/
@@ -46,4 +46,61 @@ class phpbb_test_case_helpers
{
mkdir($path, 0777, true);
}
+
+ static public function get_test_config()
+ {
+ $config = array();
+
+ if (extension_loaded('sqlite') && version_compare(PHPUnit_Runner_Version::id(), '3.4.15', '>='))
+ {
+ $config = array_merge($config, array(
+ 'dbms' => 'sqlite',
+ 'dbhost' => dirname(__FILE__) . '/../phpbb_unit_tests.sqlite2', // filename
+ 'dbport' => '',
+ 'dbname' => '',
+ 'dbuser' => '',
+ 'dbpasswd' => '',
+ ));
+ }
+
+ if (file_exists(dirname(__FILE__) . '/../test_config.php'))
+ {
+ include(dirname(__FILE__) . '/../test_config.php');
+
+ $config = array_merge($config, array(
+ 'dbms' => $dbms,
+ 'dbhost' => $dbhost,
+ 'dbport' => $dbport,
+ 'dbname' => $dbname,
+ 'dbuser' => $dbuser,
+ 'dbpasswd' => $dbpasswd,
+ ));
+
+ if (isset($phpbb_functional_url))
+ {
+ $config['phpbb_functional_url'] = $phpbb_functional_url;
+ }
+ }
+
+ if (isset($_SERVER['PHPBB_TEST_DBMS']))
+ {
+ $config = array_merge($config, array(
+ 'dbms' => isset($_SERVER['PHPBB_TEST_DBMS']) ? $_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'] : '',
+ 'dbuser' => isset($_SERVER['PHPBB_TEST_DBUSER']) ? $_SERVER['PHPBB_TEST_DBUSER'] : '',
+ 'dbpasswd' => isset($_SERVER['PHPBB_TEST_DBPASSWD']) ? $_SERVER['PHPBB_TEST_DBPASSWD'] : ''
+ ));
+ }
+
+ if (isset($_SERVER['PHPBB_FUNCTIONAL_URL']))
+ {
+ $config = array_merge($config, array(
+ 'phpbb_functional_url' => isset($_SERVER['PHPBB_FUNCTIONAL_URL']) ? $_SERVER['PHPBB_FUNCTIONAL_URL'] : '',
+ ));
+ }
+
+ return $config;
+ }
}