Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upUnescape parameters in the installation bundle #1037
Conversation
Seems pretty important to me so I'd say it deserves a unit test |
This comment has been minimized.
This comment has been minimized.
@Toflar Turns out we cannot unit test this, because the |
This comment has been minimized.
This comment has been minimized.
And what do you want to tell me now? |
As discussed, we should use |
This comment has been minimized.
This comment has been minimized.
Changed in 6a670d7. Now the code also works with a DATABASE_URL environment variable. |
Smartass :) It's a bit hacky but it's a very welcome unit test and serves the purpose. Nice one! |
Unit-testing internal methods is always wrong.
|
I have updated the PR accordingly |
This comment has been minimized.
This comment has been minimized.
I am against these changes. The unit test is supposed to test the parameter resolving, not the database connection. There is absolutely no need to inject a dependency here, especially since it is only used in the unit tests. |
'- ignore - |
Injecting the connection factory is correct. And if code adjustments are needed for unit tests it means that the class did not follow software architecture best practices before. That's clearly the case here. |
This comment has been minimized.
This comment has been minimized.
Ok, you know what? We have 54 open issues for Contao 4.9 and only three weeks left to close them. I have more important things to do than to nitpick about an unimportant unit test. I am going to release Contao 4.8 without the fix and we can discuss this in January then. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Of course your tests covers more than mine, because you are now adding tests for previously uncovered stuff (such as the DB connection). My unit test only tests exactly what has been changed in this PR. I agree that we should add tests for the uncovered stuff. There are probably other uncovered methods, too. But please do this in a separate PR instead of highjacking this one. |
Neat! Thank you! |
leofeyer commentedDec 2, 2019
Fixes #979