aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tests/RUNNING_TESTS.txt6
-rw-r--r--tests/test_framework/phpbb_test_case_helpers.php14
2 files changed, 18 insertions, 2 deletions
diff --git a/tests/RUNNING_TESTS.txt b/tests/RUNNING_TESTS.txt
index c80c42a83d..b976545c22 100644
--- a/tests/RUNNING_TESTS.txt
+++ b/tests/RUNNING_TESTS.txt
@@ -37,6 +37,12 @@ options can be found on the wiki (see below).
$dbuser = 'user';
$dbpasswd = 'password';
+It is possible to have multiple test_config.php files, for example if you
+are testing on multiple databases. You can specify which test_config.php file
+to use in the environment as follows:
+
+ $ PHPBB_TEST_CONFIG=tests/test_config.php phpunit
+
Alternatively you can specify parameters in the environment, so e.g. the
following will run phpunit with the same parameters as in the shown
test_config.php file:
diff --git a/tests/test_framework/phpbb_test_case_helpers.php b/tests/test_framework/phpbb_test_case_helpers.php
index 9c91778cb0..329af2c537 100644
--- a/tests/test_framework/phpbb_test_case_helpers.php
+++ b/tests/test_framework/phpbb_test_case_helpers.php
@@ -63,9 +63,19 @@ class phpbb_test_case_helpers
));
}
- if (file_exists(dirname(__FILE__) . '/../test_config.php'))
+ if (isset($_SERVER['PHPBB_TEST_CONFIG']))
{
- include(dirname(__FILE__) . '/../test_config.php');
+ // Could be an absolute path
+ $test_config = $_SERVER['PHPBB_TEST_CONFIG'];
+ }
+ else
+ {
+ $test_config = dirname(__FILE__) . '/../test_config.php';
+ }
+
+ if (file_exists($test_config))
+ {
+ include($test_config);
$config = array_merge($config, array(
'dbms' => $dbms,