aboutsummaryrefslogtreecommitdiffstats
path: root/tests/phpunit/includes/api/query/ApiQueryUserContribsTest.php
Commit message (Collapse)AuthorAgeFilesLines
* PHPUnit: Use FQCN with leading backslash in @covers annotationFomafix2024-11-191-1/+1
| | | | | | | | | | | https://docs.phpunit.de/en/11.4/annotations.html#covers recommends: > Please note that this annotation requires a fully-qualified class > name (FQCN). To make this more obvious to the reader, it is > recommended to use a leading backslash (even if this not required for > the annotation to work correctly). Change-Id: I7eb4b997346387e5799fa27a61ab317573124fd0
* Add namespace to includes/api classesJames D. Forrester2024-09-251-1/+1
| | | | | Bug: T353458 Change-Id: I3ea6b08c5018ba03ba45c5766e1f46e12f6b8597
* Add namespace to WikitextContentEbrahim Byagowi2024-08-061-1/+1
| | | | | | | It adds MediaWiki\Content namespace to WikitextContent and two classes related. Change-Id: Ib74e4c5b3edac6aa0e35d3b2093ce1d0b794cb6d
* ApiQueryUserContribsTest: Disable temp account featureKosta Harlan2024-06-261-0/+5
| | | | | | | | | | | | | Why: - This test exercises code that checks for IP edits What: - Disable temp user feature for this test class Bug: T365669 Change-Id: If385b71b76c16f9276c3973a02ca0c888b47d3a3
* tests: Namespace api testsReedy2024-02-181-0/+4
| | | | | Bug: T357823 Change-Id: I0d7cc2c9b166d5e5b913c1305f7cee017fe377af
* tests: Fix @covers and @coversDefaultClass to have leading \Reedy2024-02-161-1/+1
| | | | Change-Id: I5629f91387f2ac453ee4341bfe4bba310bd52f03
* Namespace User under \MediaWiki\UserJames D. Forrester2023-09-191-0/+1
| | | | | Bug: T166010 Change-Id: I7257302b485588af31384d4f7fc8e30551f161f1
* Namespace TitleValue under \MediaWiki\TitleJames D. Forrester2023-09-181-0/+1
| | | | | | | One of the big ones, so doing this alone. Bug: T166010 Change-Id: I4c901d5c32696d8334ec30cede7d9b6f3d8d645e
* tests: api: Replace some static function with servicesUmherirrender2023-07-291-4/+7
| | | | | | | Replace User::, Title:: ContentHandler:: calls to the corresponding services Change-Id: I57e47221a00eafac9f171215019cf25e19e1808e
* api tests: Call editPage() with WikiPage when used for same pageUmherirrender2023-06-241-6/+5
| | | | | | | | | | | When calling editPage() with a string it converts it to a WikiPage each time it is called. When edit a page only once that is okay, but when adding more revision to the same page it is better to pass a WikiPage instead to allow reuse of internal states of WikiPage to speed up the tests Bug: T225730 Change-Id: I7a0e7e3e75ade5d6abe8e62a03a029190f3b6da8
* Reorg: Namespace the Title classJames D. Forrester2023-03-021-0/+2
| | | | | | | | | | | | | | | | | | | This is moderately messy. Process was principally: * xargs rg --files-with-matches '^use Title;' | grep 'php$' | \ xargs -P 1 -n 1 sed -i -z 's/use Title;/use MediaWiki\\Title\\Title;/1' * rg --files-without-match 'MediaWiki\\Title\\Title;' . | grep 'php$' | \ xargs rg --files-with-matches 'Title\b' | \ xargs -P 1 -n 1 sed -i -z 's/\nuse /\nuse MediaWiki\\Title\\Title;\nuse /1' * composer fix Then manual fix-ups for a few files that don't have any use statements. Bug: T166010 Follows-Up: Ia5d8cb759dc3bc9e9bbe217d0fb109e2f8c4101a Change-Id: If8fc9d0d95fc1a114021e282a706fc3e7da3524b
* tests: Replace deprecated User::idFromNameUmherirrender2023-01-091-1/+9
| | | | | Bug: T325687 Change-Id: I4082ddc9039e8335ceab354f34f3b3ae674407c7
* tests/api: Use MediaWikiIntegrationTestCase::editPage for editsUmherirrender2022-08-061-6/+7
| | | | | | | Also improve MediaWikiIntegrationTestCase::editPage by accepting LinkTarget objects and use services instead of static functions Change-Id: I3d036b0837f212d3500159c1d3a3daa4e706882c
* API: Add IP range support to list=usercontribslziad2022-05-251-0/+1
| | | | | | | | | | | | This works by using the ip_changes table. `iprange` parameter is introduced in order to restrict input to only one range. Result is sorted by name, timestamp similar to `userprefix` parameter, and T180153 (sort by timestamp first) is not addressed. Related messages and test cases are added. Bug: T177150 Change-Id: I3b8a917aaa76e18decf85b621dc77799698e4a77
* Remove passing markTestSkippedIfDbType or add commentUmherirrender2022-01-221-3/+0
| | | | | | | | | It seems some tests are fixed in the meantime without removing the skipped part for this. Bug: T195807 Follow-Up: I58261dd70eea3581803987a4a7739c7d55558f42 Change-Id: Ie883b7056cdd0cb6bec81c2f7e4ed54177b4ecb2
* Use WikiPage::doUserEditContent() instead of ::doEditContent()DannyS7122021-06-281-2/+4
| | | | | | | | Results in passing a user where previously the fallback to $wgUser was being used, mostly in tests. Bug: T255507 Change-Id: Iabe24315b23c0ad1272353186425e71974528d23
* Use __CLASS__/::class to define callback for array_map/_filter/usortUmherirrender2021-01-221-1/+1
| | | | Change-Id: I3519dd5a1ce1ea688de602190cd74755c400c717
* Replace all call_user_func(_array) in all testsThiemo Kreuz2020-06-061-3/+1
| | | | | | | | | | | | | There is native support for all of this now in PHP, thanks to changes and additions that have been made in later versions. There should be no need any more to ever use call_user_func() or call_user_func_array(). Reviewing this should be fairly easy: Because this patch touches exclusivly tests, but no production code, there is no such thing as "insufficent test coverage". As long as CI goes green, this should be fine. Change-Id: Ib9690103687734bb5a85d3dab0e5642a07087bbc
* Mostly drop old pre-actor user schemasBrad Jorsch2019-09-091-51/+15
| | | | | | | | | | | | | | | | | | | | This removes most of the pre-actor user and user_text columns, and the $wgActorTableSchemaMigrationStage setting that used to determine whether the columns were used. rev_user and rev_user_text remain in the code, as on Wikimedia wikis the revision table is too large to alter at this time. A future change will combine that with the removal of rev_comment, rev_content_model, and rev_content_format (and the addition of rev_comment_id and rev_actor). ActorMigration's constructor continues to take a $stage parameter, and continues to have the logic for handling it, for the benefit of extensions that might need their own migration process. Code using ActorMigration for accessing the core fields should be updated to use the new actor fields directly. That will be done for in a followup. Bug: T188327 Change-Id: Id35544b879af1cd708f3efd303fce8d9a1b9eb02
* Remove unneeded overrideMwServices/resetServicesAryeh Gregor2019-08-291-7/+3
| | | | Change-Id: If6cbdec05b8f310ef3a0b4649aaa16d9fb80a047
* Default $wgActorTableSchemaMigrationStage to SCHEMA_COMPAT_NEWBrad Jorsch2019-05-011-1/+2
| | | | | | | | | | | Probably good to start testing this in CI sometime soon. This also updates a bunch of tests that were forcing an older stage to force SCHEMA_COMPAT_NEW instead, or to test both ways (until a future patch removes the _OLD version). Bug: T188327 Change-Id: Icb9b55cb9d754f2d30d6883005658b9670834756
* ActorMigration: Remove possibility of read-bothBrad Jorsch2018-10-111-18/+11
| | | | | | | | | | | | | | | | | | When this was originally written, the plan was to read both the old and new fields during the transition period, while stopping writes to them midway through. It turns out that the WHERE conditions to do read-both correctly are generally not handled well by the database and working around that would require a lot of complicated code (see what's being removed from ApiQueryUserContribs here, for example). We can simplify things greatly by instead having it write both fields during the transition period, reading from the old for the first part and the new for the second part, as is being done for MCR. Bug: T204669 Change-Id: I4764c1c7883dc1003cb12729455c8107319f70b1 Depends-On: I845f6ae462f2539ebd35cbb5f2ca8b5714e2c1fb Depends-On: I88b31b977543fdbdf69f8c1158e77e448df94e11
* Disable PHPUnit tests that fail under sqliteKunal Mehta2018-08-011-0/+2
| | | | | | | So we can make the job voting, preventing other tests from regressing. These tests can be re-enabled whenever they're made to pass. Change-Id: I959710138e1e1b37b6ba69561c2920a78208bf12
* Use PHP 7 '??' operator instead of '?:' with 'isset()' where convenientBartosz DziewoƄski2018-05-301-1/+1
| | | | | | | | | | | | | | Find: /isset\(\s*([^()]+?)\s*\)\s*\?\s*\1\s*:\s*/ Replace with: '\1 ?? ' (Everywhere except includes/PHPVersionCheck.php) (Then, manually fix some line length and indentation issues) Then manually reviewed the replacements for cases where confusing operator precedence would result in incorrect results (fixing those in I478db046a1cc162c6767003ce45c9b56270f3372). Change-Id: I33b421c8cb11cdd4ce896488c9ff5313f03a38cf
* Rename ApiQueryContributions to ApiQueryUserContribs to match api module nameReedy2018-05-261-0/+194
Change-Id: I865628b87eda7be349522fcfaf94f5563142026e