Use local configuration in tests

This way the tests should really run out of the box with what is described in TESTING.md.
This commit is contained in:
Lucas Bickel 2017-02-28 12:16:03 +01:00
parent 625f92fe44
commit 1ca47d67d5
6 changed files with 41 additions and 10 deletions

View file

@ -17,12 +17,8 @@ class Config {
"rootDir" => self::$rootDir
);
//In the unit testing environment, we always want to use our local airtime.conf in airtime_mvc/application/test:
if (getenv('AIRTIME_UNIT_TEST') == '1') {
$filename = "airtime.conf";
} else {
$filename = isset($_SERVER['AIRTIME_CONF']) ? $_SERVER['AIRTIME_CONF'] : LIBRETIME_CONF_DIR . "/airtime.conf";
}
//In the unit testing environment, LIBRETIME_CONF_DIR will our local airtime.conf in airtime_mvc/application/test/conf:
$filename = isset($_SERVER['AIRTIME_CONF']) ? $_SERVER['AIRTIME_CONF'] : LIBRETIME_CONF_DIR . "/airtime.conf";
$values = parse_ini_file($filename, true);