Commit graph

22 commits

Author SHA1 Message Date
Umherirrender 7ece0eddd0 tests: Use static provider in TitleBlacklistAuthenticationRequestTest
Shows up a deprecation message

Follow-Up: I5ff35ad0e894f0a27beae00257dc1fc599ad518d
Change-Id: I159d727d92ed1d5ca5721d9a290bff89c5922c8d
2023-05-19 22:27:21 +02:00
Thiemo Kreuz 4d2df71552 Various code style cleanups
E.g. reducing deep indention and code duplication. Removing comments
that literally repeat what the code says.

The goal is to make the code easier to read and to maintain in the
future. I hope this is the case.

Change-Id: I6f23bc61ffb8b6d42ec697fec91bb6c92152561f
2022-12-07 14:37:10 +01:00
Reedy 3113e6bf5f Namespace extension
Change-Id: I7917483168a3534d74b62dd2077026c0baa4cbe0
2022-04-08 14:24:11 +01:00
Amir E. Aharoni 1a9865db5c Rename black and white to allowed and disallowed
According to the discussions at Bug T254649 and Bug T254646
rename the lists to generic "allowed titles" and "disallowed titles"
lists.

The previous change was abandoned, probably because it tried
to say "blocklist", which can be confused for user blocking.
I see there is intention to merge this extension's functionality
into AbuseFilter, but until it happens, it would be nice
to rephrase the user-visible messages at least.

Also make the spelling of "username" and "case-insensitive" consistent
with core MediaWiki, and a few other copy editing fixes,
and fix some tests with these words.

Bug: T254650
Change-Id: I05ccc585325eb1610dd6b257a0b96ab43b0c8c8f
2021-11-06 21:09:27 +00:00
libraryupgrader 8779e481b4 build: Updating mediawiki/mediawiki-codesniffer to 37.0.0
Change-Id: I822a1e9528c542fae3bae7d21d6c6d930b2bc88c
2021-07-24 02:49:35 +00:00
vladshapik 3025d83afc Replace uses of the deprecated setters of AbstractAuthenticationProvider
Since AbstractAuthenticationProvider ::setLogger, ::setManager,
::setConfig, ::setHookContainer methods had been soft deprecated,
so its usages were removed. AuthenticationProviderTestTrait
::initProvider was used in order to initialize
TitleBlacklistPreAuthenticationProvider in the test.
* Also bump required MW version to 1.37.0

Bug: T281994
Change-Id: I15b811a8596addad7a50b13d978851ebd86da9a5
2021-05-25 16:25:07 +00:00
Reedy 94f09be46b Add txt extension to testSource
Change-Id: I6241f4fcb74dde33fd3e17b24382e38f2d601bed
2020-06-07 14:03:14 +01:00
Umherirrender 1243bed54d Use MediaWikiServices::getAuthManager
This required MediaWiki 1.35

Change-Id: I40b1cfd33427cb0c0cc3b484525997f1d2263562
2020-04-12 00:00:28 +00:00
DannyS712 eac758d44a Remove use of ApiTestCase::doLogin
Since no user was passed, it defaults to the test sysop, and no
replacement is needed

Bug: T244039
Change-Id: Idbfcbcded52566218b70ae644f61cf2dcc2c7f11
2020-02-03 06:29:22 +00:00
James D. Forrester 412cea8fef build: Upgrade mediawiki-codesniffer to v28.0.0
Change-Id: I5fe2474773a665b398ed462859bb9d94efea9026
2019-10-11 12:19:14 -07:00
Thiemo Kreuz 8b2dd9cae3 Update unspecific "array" type documentation
Change-Id: Ic1120e726be71f09fa6ebd166d4992ee2c3a3a6b
2019-06-05 18:31:39 +02:00
Umherirrender 0b3b7f67f9 Use ExtensionRegistry rather than class_exists
Change-Id: I6788d31ce53868388c9cf9ddbf432f3397363018
2019-03-03 02:36:14 +01:00
James D. Forrester 277c88d44d Drop support for operation when wgDisableAuthManager is true
This global from MediaWiki was removed in 854a462 in 2016 but we didn't
clean up after it at the time.

Change-Id: I48f5d104e5350bd2ac170afc155015b8060e2ed5
2019-02-09 12:36:25 -08:00
Umherirrender 8f64795adf Add method scope visibility
Change-Id: Ic56c953e74fc42410d3037417978c46cff910def
2018-11-01 20:27:32 +01:00
Kunal Mehta aa2d12f5d0 Remove unnecessary addition to 'include_path' in tests
Change-Id: I775e6fc9eb39a974cfae507d09b705bf5fceb553
2018-10-11 22:32:16 -07:00
Aryeh Gregor f524ba0af4 Use setGroupPermissions instead of stashMwGlobals
It's shorter, and allows us to take advantage of any future improvements
to setGroupPermissions, such as automatically resetting affected
services.

Change-Id: Ie2d1ea65c0cb334bbde1666d00781474b7ac4dab
2018-10-07 16:09:54 +03:00
Kunal Mehta 1bd1b64298 Add @covers tags
Change-Id: Ie8958e3a2d12f22b290ecc27bf078bb053f4c82f
2018-02-16 00:01:34 -08:00
Umherirrender 354ea9bb02 build: Updating mediawiki/mediawiki-codesniffer to 0.10.0
Change-Id: I023422fc492220c86c827c45150ab81b734a26e8
2017-07-08 12:41:21 +02:00
Umherirrender 55d068708a Add phpcs and make pass
Change-Id: If5a2ec9700148eb842d6580945e51e1942a2e0ed
2017-06-06 18:18:36 +02:00
Umherirrender 968c6e8cd2 Break long lines
Prepare to make phpcs pass

Change-Id: I08a1b17d1861a7719ff71087fcbb82aae55f4948
2017-06-06 17:52:28 +02:00
Antoine Musso 8e09acc804 TitleBlacklistTest singleton can now be destroyed
The test suite set $wgTitleBlacklistSources with a fixture source of
directories.  Unfortunately when running tests from MediaWiki core the
TitleBlacklist has already been set with empty value and thus setting
the global is a noop.

That later causes a test to fail because the blacklist is emtpy.

Add TitleBlacklistTest::destroySingleton() so a test can reset the
singleton when changing $wgTitleBlacklistSources.

Since that is solely for testing, throw an exception unless we had
MW_PHPUNIT_TEST defined.

Bug: T155980
Change-Id: I99c3185811ed7b2225953fa6960096985e97c4d2
2017-01-23 17:41:03 +01:00
Reedy 1ebec92f0a Remove 'UnitTestList' hook
No longer needed now that extension unittests are autodiscovered.

Bug: T142120
Bug: T142121
Change-Id: Id86f4909e9c74c884ce33434717ad6993cbcc2bd
2016-08-05 17:38:12 +01:00