In EventMapperTest, suppress notifications created by calling
getExistingTestPage. So far, this test only worked because the existing
test page is created in addCoreDBData (and not inside the test), but
this will no longer be the case after core change
I308617427309815062d54c14f3438cab31b08a73. Clear the PageSaveComplete
hook handlers to prevent that.
DiscussionParser has a static cache of revision data that can become
stale when data is deleted between tests (because revision IDs can be
reassigned to different pages, similar to T344124). This cache seems
needed, and converting the class to a service seems hard, so add the
page title to the cache key to try and avoid collisions. This can still
break if two tests are using the same page, which is hopefully quite
unlikely.
Change-Id: Ic4cbd8ff424e1260544ff9754e0c89dd4bb2f733
This code has been moved to Minerva and is no longer serving any
purpose. The handlers are replaced with an already standardized
mw.hook for Minerva to subscribe and respond to.
Bug: T342907
Depends-On: I55c18cf723a32f80b93a01dd0687e005162c4e93
Change-Id: I2f923e509d24524a2375ffbe6b3ef336487574bb
The use of "HookHandlers" attribute in extension.json makes it possible
to inject services into hook handler classes in a future patch.
Bug: T315938
Change-Id: I84027e2899b4a013b78fe4e95f191f1e4c89b5f8
Singletons are bad, amongst other reasons, because they're never reset
in tests. They can therefore occasionally cause test failures if the
cached data stored in one of these singletons becomes stale.
As noted on the task, ideally these two classes shouldn't exist at all,
and core should be responsible for caching the information it deems
expensive to compute.
As a temporary (TM) workaround, make both classes actual services, so
that the setUp/tearDown logic in MediaWikiIntegrationTestCase can
properly reset them between tests.
Dependencies are intentionally not being injected, precisely because
these classes should just be deleted, not improved.
Bug: T344124
Change-Id: I58b8d9610f9447468235b94d25732528ab6acce6
The test was assuming that the ID 1 belongs to a user other than the one
being created in the test. This is not necessarily the case, so make it
use an ID that is guaranteed to be different.
Also rename the test fail to avoid a PHPUnit deprecation of test class
name not matching file name.
Bug: T342428
Change-Id: Ied1869e380b023c1a726a5be610e1de1b68c78c0
The test doesn't need the database, but it's currently trying to use it.
Mock all services used by EchoDbFactory to avoid that (the Factory
cannot be mocked directly because it's created with a static method and
not injected).
Change-Id: I359489ed3f8de6e868a590d5c7c02f81f0a2049d
Use mocks when possible, and add the test to the Database group
otherwise.
Also rename 2 test files to avoid a PHPUnit deprecation of file name not
matching class name.
Change-Id: I16b2392daf01f63511c82b4ed0e67a38e35ddbe1
This will essentially all be deleted after I55c18cf723a32f80b93a01dd0687e005162c4e93, but thats fine\
Bug: T343053
Change-Id: Ifb382af388cdc24dc1ecef105ec89c9129194c19