Commit graph

29 commits

Author SHA1 Message Date
Fomafix ffce132ec7 Use overrideConfigValue instead of setMwGlobals
Change-Id: I09c1c2c009b5384532b53bae489c9af882091283
2024-07-29 20:55:45 +00:00
Umherirrender 954db277fc Use namespaced classes
Changes to the use statements done automatically via script
Addition of missing use statement done manually

Change-Id: I3a7b448f3793f6690bb329a2e5255a558048ed5a
2024-06-10 22:05:45 +02:00
Umherirrender 9de38d445a tests: Ensure user exists in TitleBlacklistPreAuthenticationProviderTest
Change-Id: I63c4879baa3c03980f11590f1db729e27ce307e4
2023-12-28 00:53:21 +01:00
Umherirrender c5bee58799 tests: Add group Database to ApiTitleBlacklistTest
Change-Id: I14c964574d9ed6ac8ff6ca3ed5bab452d08d0b67
2023-09-26 21:45:34 +02:00
Umherirrender ffc9986a95 api: Rename php class behind action=titleblacklist
titleblacklist is not part of action=query (since a2f5ccd2 back in 2011)
and should not follow that naming schema.

No class alias as nobody needs to call the class directly

Change-Id: If57e5bd9291a894edf42835fed07d37cd8e8abed
2023-07-04 22:42:50 +02:00
Daimona Eaytoy bf76b5fe55 Remove redundant documentation from test
We generally do not put these instructions in every test. A README file
would be more appropriate, but since there isn't one, I'm not sure if
it's needed, especially because the instructions for running tests
should ideally be the same for all extensions, and those could be
documented in a single place.

In particular, remove reference to soon-to-be-deprecated phpunit.php and
other information that can easily be found in the first 10 lines of
code.

Bug: T90875
Change-Id: I97e6f608f8a3f11febf33c38811fe7692be59e24
2023-07-02 18:31:45 +02:00
Umherirrender d01b9a933c tests: Make PHPUnit data providers static
Initally used a new sniff with autofix (T333745)

Bug: T332865
Change-Id: I6941b43f599063864de59bd7906beb082278fdea
2023-05-20 14:16:31 +02:00
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