TestingEnvironmentManipulator shouldn't use DB before plugins are loaded #12658
Labels
c: Tests & QA
For issues related to automated tests or making it easier to QA & test issues.
Milestone
In a test I noticed that the TestingEnvironmentManipulator will access the database when an environment is bootstrapped: https://github.com/matomo-org/matomo/blob/3.x-dev/tests/PHPUnit/Framework/TestingEnvironmentManipulator.php#L106-L122
However, plugins do not get loaded until after the
Environment::init()
function is called. This means the database connection will be created before plugins are loaded, and events likeTracker.getDatabaseConfig
will be invoked before plugins are loaded.So if you handle an event like this in a plugin, during tests they may not be invoked.
The text was updated successfully, but these errors were encountered: