Hey, I am not very happy about this but we came to the case > where it might be useful to explicitly uninstall some > hook(s) for out unit tests. > > You might want to checkout MediaWikiTestCase:: > uninstallHook > > https://gerrit.wikimedia.org/r/#/c/99349/ > > I am not happy about blurring differences between unit > and integration testing, but breaking core with extensions > and vice versa is sometimes useful. >
If you have a test that is impacted by the hook system, it is not a real unit test. Making real unit tests for most MediaWiki code is easier said then done, though this is caused by the code, not the testing framework. To quote Misko Hervey, "the secret in testing is writing testable code". I recommend trying to minimize not needed binding in both production code and tests. For instance deriving from MediaWikiTestCase should not be needed often. Bad test code is as much a liability as bad production code. Cheers -- Jeroen De Dauw http://www.bn2vs.com Don't panic. Don't be evil. ~=[,,_,,]:3 -- _______________________________________________ Wikitech-l mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/wikitech-l
