Why:
- Title has several in-memory caches for Titles constructed via
newFromText() and for the canonical mainpage instance that
isMainPage() compares against.
- These caches are not reset between tests, which can cause cryptic
integration test failures. It's not safe to persist either of these
caches across tests, as neither the internal state of Title objects nor
the identity of the canonical mainpage is valid across tests.
What:
- Clear the cached main page instance in Title::clearCaches().
- Call Title::clearCaches() from MediaWikiIntegrationTestCase::resetNonServiceCaches().
Bug: T395214
Depends-On: Ic35b45015ff5a53f6e728b69b59cc57efe0b390b
Change-Id: Ie6cac7e1282f794277dfc8ff3673f12e9969818c
(cherry picked from commit 3f7905bc9ff9006831f8573b7fe948dc7243107e)