Commit graph

12 commits

Author SHA1 Message Date
Daimona Eaytoy da1af447e2 Always pass a User object to SpamBlacklist::filter
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
2020-11-10 19:13:01 +00:00
daniel 5b0da2baf3 Ensure instance cache does not interfere with tests.
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
2020-09-29 17:20:44 +00:00
Umherirrender 1cdb1d25c8 Use MediaWikiServices::getMessageCache
This required MediaWiki 1.34

Change-Id: I86291dfaf83cdeeb96693979272bf7d4589d650f
2020-03-14 14:20:50 +01:00
James D. Forrester 5a78869772 build: Upgrade mediawiki-codesniffer to v28.0.0
Change-Id: I2e639461d789d0b293d0f97da30a2fcf160804a6
2019-10-11 11:58:00 -07:00
MarcoAurelio 54295ecd04 Use https:// on Wikimedia sites in documentation
Change-Id: I82bcd93e32fce8fe59c5053cc298e84559d32a0b
2019-06-01 10:21:28 +00:00
Umherirrender 2ec8f276bb Add @group Database to unit test
Used database by inserting pages

Change-Id: Id81425fff0a41c651c1967698124246befcdb032
2018-09-15 18:18:04 +00:00
Umherirrender 760df43e2d Add @covers to unit test
Bug: T195163
Change-Id: If480e39821580195846b47c0126761be92fa1376
2018-08-25 06:03:08 +00:00
Kunal Mehta 66e8e29ea6 Unbreak BaseBlacklist::getTypeFromTitle() and add tests
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
2017-07-08 01:39:16 +00:00
Kunal Mehta e6b3d85641 Fix incorrect @group tag in SpamBlacklistTest
Change-Id: I7dab37ff5a7a88207d8b1148c90d1f6e24f925f6
2017-07-06 03:22:50 +00:00
Umherirrender 83cd96ed55 Split multi variable declaration
Each variable should have a documentation block

Change-Id: I53af14d18d3a11ee38256afe7e9d001a2641e466
2017-06-29 18:53:19 +00:00
Umherirrender 3c4e117932 Add phpcs and make pass
Change-Id: I623a982fe6362daab34906a111d123f19676dc22
2017-06-06 18:29:27 +02:00
Matthew Flaschen e0ffbe322e Import PHPUnit tests from Flow, plus one more
Based on Flow repo as of 6099ce48818c8188709352b592f9da118a361fa5 .
Used under GPLv2+

Change-Id: Ibac17d99e86688ced2989ce9ae45581f09c85bd4
2017-05-01 19:20:14 -04:00