Commit graph

20 commits

Author SHA1 Message Date
Umherirrender 54bb17f0a0 tests: Use assertStatusOK for better failure messages
Change-Id: I1bd4665024a311c4264b9bb680c6d6b4c31be333
2023-10-27 16:20:53 +02:00
gerritbot effea0bde6 Replace some moved Title class uses, now MediaWiki\Title\Title
Bug: T321681
Change-Id: I36f07ad64f90049b412969654cff0d3da31777e6
2023-08-19 04:19:23 +00:00
Umherirrender 583de1d25b tests: Make PHPUnit data providers static
Initally used a new sniff with autofix (T333745)

Bug: T332865
Change-Id: I7825cbc1fa46d95e5ad4a13cc3440db323541956
2023-05-20 14:09:37 +02:00
gerritbot a76f8baf06 Update moved class EditPage
See T321882. Moved in Ibefc44eb64aed

Bug: T321681
Change-Id: I8f98cecb9177edb9de973cda7b2e10bb10743483
2023-05-06 21:20:28 +00:00
Reedy 52bb0939d9 Namespace extension
Change-Id: Ie53302078d5f405eaa6caef3b7ef4daebf47d877
2022-04-08 13:41:20 +00:00
Alexander Vorwerk ef084bbead MediaWikiTestCase -> MediaWikiIntegrationTestCase
MediaWikiTestCase has been renamed to MediaWikiIntegrationTestCase in 1.34.

Bug: T293043
Change-Id: Ie7b8882367285568ac7fcf2a28e1c7931bb5c059
2021-10-12 01:04:44 +02:00
daniel 24d3c2d7c3 Add integration test
This test ensures that SpamBlacklist prevents edits that contain spam.

Change-Id: I18e205752d9c5428bb52ebf41ad10fa29e813247
2021-07-27 10:26:41 +00:00
libraryupgrader 3b79f98ba8 build: Updating mediawiki/mediawiki-codesniffer to 37.0.0
Change-Id: Id3f23569f8c6726382dfc1723516ce093df9adb6
2021-07-24 02:17:52 +00:00
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