Commit graph

11 commits

Author SHA1 Message Date
Umherirrender
d36073cdcf tests: Make some PHPUnit data providers static
Initally used a new sniff with autofix (T333745),
but some provide are defined non-static in TestBase class
and need more work to make them static in a compatible way

Bug: T332865
Change-Id: I889d33424f0c01fb26f2d86f8d4fc3de3e568843
2023-05-20 01:05:27 +02:00
Derick Alangi
d4ae3e8839 tests: Migrate away from setMwGlobals() to overrideConfigValue(s)()
Change-Id: I1b0e8e2cf4d85ae5ce8ad090cfc47f5086350702
2022-08-14 22:23:25 +01:00
Umherirrender
a76ed60462 watcheditem: Replace deprecated User::getOption
Bug: T296083
Change-Id: I703036d64006fed363cbe93040b928287a4530bd
2022-08-05 22:31:09 +00:00
Alexander Vorwerk
decbaf4f38 phpunit: use ->getServiceContainer() in integration tests
Change-Id: I38299cb65eeaadfdc0eb05db4e8c0b0119cfb37d
2022-01-27 22:04:16 +01:00
DannyS712
47d70dbfba Post Revision-removal cleanup
Updates for the removal of the Revision class itself
and the various methods/hooks/variables removed in the
process, including:

- Update some documentation removing most references
to the Revision class and updating the MCR migration
notes to reflect the past tense for Revision methods.

- Change some capitalization from "Revision" to "revision"
to make it clear comments are about revisions in general,
not the Revision class in particular.

- Minor code tweaks including removing unused variables that
were around for the old hooks that were removed, and
removing the use of DeprecatablePropertyArray where no
longer needed for anything.

- Fix incorrect documentation for PageUpdater::getStatus(),
the status value changed a while ago to have revision-record
in addition to revision, and recently to only have the
revision-record, but ironically PageUpdater was never updated.

- Removed Parser::$mRevisionObject, used to be a Revision object
and was deprecated in 1.35, missed earlier because it was no
longer being set to Revision objects, always null.

- Add RevisionRecord typehints in DummyLinker to match those
in the corresponding Linker methods

This should be a no-op in terms of functionality.

Bug: T247143
Change-Id: I03bbb94fc29085855448780b1a5ad9063911ecc4
2021-06-24 00:32:39 +00:00
DannyS712
be174c4dc1 Make WatchedItemQueryServiceUnitTest a pure unit test
The `testGetWatchedItemsWithRecentChangeInfo_watchlistOwnerAndInvalidToken`
method (and its data provider) moved to the remaining integration test,
since those actually do require integration

Also do some minor clean up to the unit tests:
* Replace ::getFakeRow with manual (object) casts
* Combine duplicate getMockNonAnonUserWithIdAndRestrictedPermissions
and getMockNonAnonUserWithIdAndNoPatrolRights

Change-Id: Ie853f465b39f06dadd65582df061a9c44068b63a
2021-01-15 00:50:18 -08:00
Holger Knust
c52abea014 Manually redirect in UploadFromUrl
The upload function saved the redirect page(s) content together with the upload file content which would produce an incorrect MIME type (text/html instead of actual upload MIME type). Disabled the automatic redirect and reset the file content until the final file location or the maximum number of redirect is reached.

This patch also touches WatchedItemQueryServiceIntegrationTest to make
it more robust. Without this change, UploadFromUrlTest interfered with
WatchedItemQueryServiceIntegrationTest in some way, causing it to fail.

Bug: T258122
Change-Id: I1de709576c02ce5b31b356751680cbd23689a3fa
2020-09-14 21:36:36 +02:00
DannyS712
94169ee873 Whitespace cleanup: Use tabs for indentation, avoid double spaces
Change-Id: I346073b59d283029bd6666356c62c81e687ea5e6
2020-06-27 07:53:07 +00:00
Thiemo Kreuz
5f3a92385b Fix visibility of setUp/tearDown
Change-Id: I636be48eb9f713680abac35d46091f7b49374696
2020-06-16 21:02:05 +02:00
hmonroy
cc9dba469d Add check to api that filters out expired watchlist items
Add logic to API module that outputs the watchlist (api.php?action=query&list=watchlist)
to filter out expired watched items when $wgWatchlistExpiry feature flag is turned on.

Bug: T247029
Change-Id: I49e7959b5166e74c95106a20d965dec6a0590a87
2020-04-03 15:06:32 -07:00
Sam Wilson
6615190254 Add support for watchlist expiries to WatchedItemQueryService::getWatchedItemsForUser()
This method is only used by ApiQueryWatchlistRaw.

Bug: T247026
Change-Id: I7852bea84c3310e01a9fa2b6fda658e89346980c
2020-03-13 10:06:04 +08:00