Navigation Menu

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TestingEnvironmentManipulator shouldn't use DB before plugins are loaded #12658

Open
diosmosis opened this issue Mar 27, 2018 · 0 comments
Open
Labels
c: Tests & QA For issues related to automated tests or making it easier to QA & test issues.

Comments

@diosmosis
Copy link
Member

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 like Tracker.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.

@diosmosis diosmosis added the c: Tests & QA For issues related to automated tests or making it easier to QA & test issues. label Mar 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: Tests & QA For issues related to automated tests or making it easier to QA & test issues.
Projects
None yet
Development

No branches or pull requests

2 participants