Why:
* SpamBlacklistTest::testSpamEdit fails to run when temporary
accounts are enabled, because the EditPage object does not have
the user set as the same as the RequestContext user (which is
a named test user).
* Making the test pass is necessary for running tests when
temporary accounts are enabled in CI.
What:
* Set the EditPage context user as the same as the test user used
for the article context above.
Bug: T355879
Change-Id: I34e0299a9d9e3078f9067390e30dca7ce9665de4
Why:
- Temp accounts require special handling in the test case, since we call
SpamBlacklist->filter() directly.
- We want to continue to test both IP editing and temp account editing
paradigms
What:
- Duplicate the testSpam() method to have one invocation run with temp
users, and a second one with the anonymous IP editing paradigm
- Have the testSpamAnonEditing use a anonymous user object returned from
user factory, to avoid ActorStore deprecation warnings where the
mocked wiki ID is null while the wiki's wiki ID is false
- Rename setUp to a "prepareGlobals" method, and invoke this after the
enable/disable temp account method. That's needed because
disableAutoCreateTempUser ends up invoking resetServices()
Bug: T355879
Change-Id: I604c521f00d5cc64b8102c93f9a013bcac557001
This requires 1.42 for some new names
Changes to the use statements done automatically via script
Addition of missing use statement done manually
Change-Id: I9a7df2df9407ef10d855bc19db247983682a5fc8
There are some usages outside of SpamBlacklist that must be fixed. After
doing that, the signature should be updated to make the user
non-optional.
Note: I've changed the signature because external callers only pass the
first two parameters. Hence, it's easier to change it now, add a
User parameter to the callers and then make it non-optional, than having
to pass $preserveLog and $mode in all callers and then swapping the
order (as that would break the world).
Change-Id: I0714eb9dbc6af3c775ab7a81cb4b59e687183f77
Tests need a way to rest BaseBlacklist::instances, so they can be sure
they operate on a clean slate. This is also needed to ensure they do not
operate on real settings, targetting a real remote host.
Bug: T262443
Change-Id: Ic320f7a72da7f26e0931ce3d393fc5a61d43d4fc
Introduce BaseBlacklist::getSpamBlacklist() and getEmailBlacklist()
as type-documented alternatives to getInstance( 'email/spam' ) so we
don't need to keep documentating types in a comment when using a function
that isn't included in the base class.
Change-Id: Ic8bd8f803ddbce1294707d5f1d62b701e24d8c6e
The first part of the title is supposed to be capitalized, so call
ucfirst on it, and then make blacklist and whitelist lowercase. Add
tests to verify the known blacklist and whitelist types are recognized
correctly.
This will make validation of SpamBlacklist messages upon edit work
again.
Bug: T169838
Change-Id: I98688362f222ab65115fbec46e0f67587d19022d