Commit graph

22 commits

Author SHA1 Message Date
Umherirrender c697355f04 Use namespaced classes
Changes to the use statements done automatically via script
Addition of missing use statement done manually

Change-Id: I230ada2f4ad95f86593759e8320d47acdf06a749
2024-10-20 13:21:21 +02:00
Fomafix 41e2942d94 Use namespaced PHP classes
Change-Id: I98890c4a41c913b5e20c97c9ad1deaa4c2b4fe5b
2024-05-11 08:58:37 +00:00
Umherirrender f5db77c750 Use namespaced classes
This requires 1.42 for some new names

Changes to the use statements done automatically via script
Addition of missing use statement done manually

Change-Id: I1b433ab02231087e0f84a734092751ce2cf28b2c
2024-01-04 22:22:56 +01:00
Martin Urbanec 9cef38e80f IP Masking: Do not allow temporary users to thank other users
It has been decided to not allow temporary users to thank
other users (see task). This is because the transition
between anonymous and temporary account is nearly invisible,
and it might be confusing why the thanking ability appears
and hides.

Bug: T345679
Change-Id: I62e67327c9a80b3da9e98a2dccdd4ec2051f3026
2023-10-03 22:23:02 +00:00
Daimona Eaytoy cae27c61f3 Add ApiCoreThankUnitTest to the Database group
The test needs the DB for various things related to user blocks.

Change-Id: I1076c347f02de7285e1fdc77feccb59ad60cd08a
2023-08-06 21:30:56 +02:00
Func b96b4e1fde ServiceWiring: Rename LogStore to ThanksLogStore
`LogStore` is too ambiguous, usually services from extension should
be prefixed with its name.

Change-Id: Ia8a8474ac44ee9990b22ca4650d3ae5311744d19
2023-05-26 21:08:54 +08:00
jenkins-bot cfb40caaa8 Merge "tests: Make PHPUnit data providers static" 2023-05-21 13:06:59 +00:00
Umherirrender fc84a35180 tests: Make PHPUnit data providers static
Initally used a new sniff with autofix (T333745)

Bug: T332865
Change-Id: Id40d7df5f9d380aca50ce4c15bbf83897333ecc5
2023-05-20 19:12:59 +02:00
Marcin Kostrzewski e483b844c9 API: Refactor to match modern code standards
I've moved all API classes into a separate folder,
as I felt like grouping modules improves readability.
APIs themselves had storage logic which I extracted and put
in another folder. I was originally going with an interface
to the storage to allow for other storage methods than
log entries, but the code was too tightly coupled with it,
so I've left that for another day. Added dependency injection
for all services and used ServiceOptions for config vars.

Bug: T337002
Change-Id: Ie8a1f435d635e1d0e1286f673bfe96cc4fdfe4fe
2023-05-20 17:57:26 +03:00
Bartosz Dziewoński dc8f07d2af API tests: Assert error codes, not error messages
Depends-On: I752f82f29bf5f9405ea117ebf9e5cf70335464ad
Needed-By: Ie17987991d1e9a0d77da97e3a81fe0a21c6d7866
Change-Id: I353e34d81afaa06750f8725181c808fabcebea42
2023-04-26 17:55:21 +00:00
AnaïsGueyte d287af1af1 Remove GlobalBlock calls from Thanks
Remove the usage of User::isBlockedGlobally and User::getGlobalBlock

Bug: T318891
Change-Id: I79450b34523d0ecb1a7a7b1e5a99b7650e02866e
2022-11-09 14:01:45 -05:00
Alexander Vorwerk 559e3e04ce MediaWikiTestCase -> MediaWikiIntegrationTestCase
MediaWikiTestCase has been renamed to MediaWikiIntegrationTestCase in 1.34.

Bug: T293043
Change-Id: Ic6305e141941667fc52844ae45386ce69a60e8e4
2021-10-13 12:28:31 +02:00
Roman Stolar 28501aa637 Update DatabaseBlock construct option 'by' to use User Identity only
Bug: T283641
Change-Id: I0b79f99f89d386288529cd17b8542b90cccf451a
2021-06-01 12:21:42 +03:00
STran 43dd004a62 Allow partially blocking giving thanks
- Add hook to enable blocking thanks
- Check if user is blocked from 'thanks' action
  and disable giving thanks from  API and UI if so

Bug: T242785
Change-Id: I290a7c39c6fcb22a8ab4a9ecbad76a239cb18ea0
2021-05-12 13:06:09 -07:00
Umherirrender 6a8776d1b1 Use ::class for class name
This works also for non-existing classes,
because it is resolved on compile time

Change-Id: Ib40f1aeea35e474530fea42c43d593f6c86f4487
2021-04-08 21:14:44 +02:00
Reedy 3749db7eba Namespace extension
Change-Id: Ic9e0b8d6b3cc6b9be4d6b026cb0a3b4a12aef38f
2021-03-20 18:22:17 -07:00
Umherirrender 1ec0aed694 Inline class property in tests
Change-Id: Iaa52bd9faafee62ac524e19964bd1aa2feea129b
2021-01-17 20:15:26 +01:00
Daimona Eaytoy 2b81f0333f Clean up some PHPUnit 4 bc stuff
Bug: T192167
Change-Id: I5b08e479329503ee651580005fe7347f22939ca4
2019-10-13 11:41:05 +02:00
Max Semenik be060b3d07 tests: setExpectedException() is deprecated
Change-Id: Ie9500ff2dabb9315f6fe8344acdfbb1f3f1aac33
2019-10-12 15:55:31 -07:00
Thalia a95e0e2b91 Use MediaWiki\Block\DatabaseBlock instead of Block
This follows the rename of the Block class in I6d96b63ca0.

Change-Id: I6c0244987a9b2b1d62efabc2da78b79711dad878
2019-05-31 16:44:56 +01:00
Thalia 810de9afbd Allow partially blocked users to use Thanks
Only prohibit users from using Thanks if they are blocked from the
associated page. This allows partially blocked users to use thanks
most of the time.

It also allows blocked users to thank on their own talk page, if
they are allowed to edit it, even if they are sitewide blocked.

Bug: T221371
Change-Id: Ic99ec38ea200e806963951b2dd67e56ecde63752
2019-05-22 22:05:33 +01:00
Sam Wilson 78831d2b68 Rename files and classes in preparation for adding log-thanks
Bug: T186855
Change-Id: I20f5d200c33e395aca9489b73d0ed9b1d0ad5b8c
2018-02-21 12:49:21 +08:00
Renamed from tests/phpunit/ApiRevThankUnitTest.php (Browse further)