adapt tests to new dotenv environment

DB tests now can simply set the environment to change configuration
variables. API tests still rely on a configuration file.

Also, query.php needs to set up the CONST_* variables to work with
the query scripts. That is a tiny bit messy and duplicates code
but this part will need to be reworked later.
This commit is contained in:
Sarah Hoffmann
2020-12-17 11:46:01 +01:00
parent 06d89e1d47
commit d97aed8741
4 changed files with 40 additions and 11 deletions

View File

@@ -715,6 +715,8 @@ class SetupFunctions
$rOutputFile = fopen(CONST_InstallDir.'/settings/settings-frontend.php', 'w');
fwrite($rOutputFile, "<?php
if (file_exists(getenv('NOMINATIM_SETTINGS'))) require_once(getenv('NOMINATIM_SETTINGS'));
@define('CONST_Database_DSN', '".getSetting('DATABASE_DSN')."');
@define('CONST_Default_Language', ".getSetting('DEFAULT_LANGUAGE', 'false').");
@define('CONST_Log_DB', ".(getSettingBool('LOG_DB') ? 'true' : 'false').");