Commit graph

37 commits

Author SHA1 Message Date
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
zoranzoki21 3d957b51aa Upgrade TitleBlacklist extension to use newer version of phan
Bug: T216946
Change-Id: I70762433e25706487864c86980daa797d6c60f8d
2019-02-25 20:14:35 +00: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 928355054d build: Updating mediawiki/mediawiki-phan-config to 0.2.0
Change-Id: I71c824d1ccb8bd448fc7437cd3e760293b1fe097
2018-04-05 17:23:47 -07:00
Kunal Mehta 1bd1b64298 Add @covers tags
Change-Id: Ie8958e3a2d12f22b290ecc27bf078bb053f4c82f
2018-02-16 00:01:34 -08:00
Kunal Mehta ce26a81824 Migrate to mediawiki-phan-config
Change-Id: I8e05d8fafc5638b2b8d4c6dad73955545084d122
2018-02-15 14:37:12 -08:00
Rafid Aslam eac33eeff6 Add phan configuration for static analysis
Bug: T179554
Depends-On: I25beea963444b715bed7b2890475c0c812949520 
Change-Id: I83f9374b2f3236097860f4aecc694326b891905b
2017-12-25 19:31:23 +00: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
Brad Jorsch 49e8bf1d44 ApiQueryTitleBlacklistTest needs to restore globals
I guess this only ever worked before because none of the other tests
depended on these globals. Now that AuthManager is enabled by default,
one does.

Change-Id: If335fcc9b844a518b2c56bfa39153159261ae314
2016-05-31 10:57:14 -04:00
Gergő Tisza 17d3a9e313 Update for AuthManager
Bug: T110469
Change-Id: I9690d2fe6b172fcc85e1a8f7f91af21c6422d870
Depends-On: I8b52ec8ddf494f23941807638f149f15b5e46b0c
2016-05-12 00:23:11 +00:00
Alex Monk d372b43a75 Use extension registration, replace constants with some reasonable values, kill i18n shim
Bug: T87982
Change-Id: I9ab045da49179618d7c5558b2b066fba2736ae6e
2015-05-19 17:23:14 +01:00
Kunal Mehta 11841f7d8d spaces --> tabs
Change-Id: I11ba313f35b7d04a6f93c42f83f00a5e403bdf0a
2015-01-06 16:55:42 +00:00
Kunal Mehta 6863a39ed9 Optionally integrate with AntiSpoof
Introduces a new "antispoof" parameter. If set, try to normalize
the title using the AntiSpoof extension.

Bug: 53901
Change-Id: I9b3c5f5f5d9eeda65562fd83e21c9c2ba97e5569
2013-11-13 15:30:04 -08:00
Marius Hoch b6325e875b Fix the use of globals in ApiQueryTitleBlacklistTest
Change-Id: I5461277f06f336142f2de0aaf122a8ea767d74a4
2013-05-15 14:14:43 +02:00
Victor Vasiliev 52bab2daed (bug 36939) Introduce a way to limit username filter to certain sources.
* Name all sources and track them inside the entries. This should be
  fully backwards-compatible with previous configuration format,
  since numbers may be a legitimate source names as well.
* Introduce $wgTitleBlacklistUsernameSources as a variable which allows
  to specify which sources may be used for filtering usernames.

Change-Id: Ia2702370c85f317c763e345c8f92cb38e23e4196
2013-02-20 22:54:25 -08:00
Marius Hoch fc27474834 Fixing several issues with the titleblacklist API
I've fixed four issue with the API of this extension:
1. The extension always assumed the user wants to override the
   blacklist, if he's allowed to do so, but that's not the case.
   Introduced 'tbnooverride' to prevent that.
2. The API used actions not internally supported by
   TitleBlacklistEntry::matches() which made it impossible to check
   whether an account name is ok, if the regexp which would prevent
   this was set to new account only. Therefore I've introduced the
   new action 'new-account'.
3. Same as 2 for the 'upload'
4. The API always returned the 'titleblacklist-forbidden-edit'
   message, even if there was a more suitable one. Fixed that.

Example:
 https://meta.wikimedia.org/w/api.php?action=titleblacklist&tbtitle=User:Steward&tbaction=create
 (this should match the expression .*steward.* <newaccountonly> on
 https://meta.wikimedia.org/wiki/Title_blacklist but it doesn't)

Furthermore I've adjusted the unit tests slightly to test whether
tboverride works and whether <newaccountonly> works.

Change-Id: I2d948c84de39c6ee1c1eea7e6cd7b31506d6cb92
2012-10-27 14:41:15 +02:00
Siebrand Mazeland 16f32456ad Maintenance for TitleBlacklist extension.
* Use Message class.
* Remove trailing whitespace from 'titlewhitelist'.
* stylize.php.
* Update .gitignore.

Change-Id: Ie78fa25816808b0a695cc20630097326fb4cf705
2012-09-18 15:57:57 +02:00
Antoine Musso 506470fd79 tests: switch parameters in assertEquals()
assertEquals has the expect as first parameter.

Change-Id: Ic742aae7c84444817de7855b004695a32195d18a
2012-08-29 15:51:27 +02:00
Antoine Musso 31c466e0f7 tests: split listed/unlisted tests
Factored out common code in setup(), that also fixes the tests on my
local machine.

Change-Id: I4083c27842ccb475e2ce3cfbffb6cd35cbd15cc0
2012-08-29 13:47:38 +00:00
Sam Reed e6975d6152 Fix more comments 2011-10-14 21:30:16 +00:00
Ian Baker 74c1bef009 checking in tests that were missed in r93659 2011-08-01 22:44:54 +00:00
Ian Baker a9b8637fbe Added additional entry for non-automated testing
Added additional return data: raw blacklist line
switched to wfMessage from wfMsg
updated tests
followup to r92805
2011-07-29 17:19:51 +00:00
Ian Baker 039c877658 changed api output for blacklisted entries to be something more correct and informative ("error" is misleading).
followup to r93137
2011-07-28 20:32:48 +00:00
Ian Baker 4e57d6c1e9 Fixed unit test
Removed unnecessary method, re r92807
2011-07-23 00:23:09 +00:00
Ian Baker 00242b75f1 Added an API to TitleBlackList to make it possible to check the blacklist in advance. Makes for more responsive UI. 2011-07-21 22:08:44 +00:00