mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-31 05:50:42 +02:00
[task/mssql-db-tests] Allow test configuration with environment variables.
To allow execution of the tests with different configurations without having to use the test_config.php file, environment variables of the form PHPBB_TEST_<name> can now be used, e.g. PHPBB_TEST_DBMS to set the variables otherwise expected in test_config.php PHPBB3-9868
This commit is contained in:
@@ -85,7 +85,18 @@ abstract class phpbb_database_test_case extends PHPUnit_Extensions_Database_Test
|
||||
{
|
||||
static $show_error = true;
|
||||
|
||||
if (file_exists('test_config.php'))
|
||||
if (isset($_SERVER['PHPBB_TEST_DBMS']))
|
||||
{
|
||||
return 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'] : '',
|
||||
);
|
||||
}
|
||||
else if (file_exists('test_config.php'))
|
||||
{
|
||||
include('test_config.php');
|
||||
|
||||
|
Reference in New Issue
Block a user