matomo-org / matomo

Empowering People Ethically with the leading open source alternative to Google Analytics that gives you full control over your data. Matomo lets you easily collect data from websites & apps and visualise this data and extract insights. Privacy is built-in. Liberating Web Analytics. Star us on Github? +1. And we love Pull Requests!
https://matomo.org/
GNU General Public License v3.0
19.91k stars 2.65k forks source link

Config.ini.php shouldn't affect test enviornament. #9484

Open sebastianpiskorski opened 8 years ago

sebastianpiskorski commented 8 years ago

If I set some value in config.ini.php

[MySection]
key = value

running any test I get:

$config = Config::getInstance();
var_dump($config->MySection);
//Output:
array(1) {
  'key' =>
  string(5) "value"
}

it shouldn't be visible from tests, shouldn't be set implicitly in environment. Tests should use only global.ini.php, and explicit TestConfig class.

Why is this bad?

mattab commented 8 years ago

:+1: absolutely agree. Our tests shouldn't depend on the local configuration file. a pull request would be very welcome, or we will investigate in coming months / during 3.0.0 dev cycle