aboutsummaryrefslogtreecommitdiffstats
path: root/tests/phpunit/includes/api/query/ApiQueryUserInfoTest.php
Commit message (Collapse)AuthorAgeFilesLines
* PHPUnit: Use FQCN with leading backslash in @covers annotationFomafix2024-11-191-2/+2
| | | | | | | | | | | 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-2/+2
| | | | | Bug: T353458 Change-Id: I3ea6b08c5018ba03ba45c5766e1f46e12f6b8597
* TempAccounts: Rate limit acquisition of temp account namesKosta Harlan2024-04-231-1/+2
| | | | | | | | | | | | | | | | | | | Why: - We don't want to allow unlimited acquisition of temp account names. These should be rate limited in similar way to how we limit the creation of temp accounts What: - Provide a TempAccountNameAcquisitionThrottle, and use it in the acquireName() method - Set a default that is 10 times the limit of TempAccountNameCreationThrottle Depends-On: If660aad1d0f04f366414084aff3f88484a19d416 Bug: T343101 Change-Id: I99d5973498a89ac227847de5837c0a8e895c28fb
* Add 'temp' flag to ApiQueryUserInfo APIDreamy Jazz2024-02-281-0/+48
| | | | | | | | | | | | | | | | | | Why: * The ApiQueryUserInfo API returns 'anon' as true when the user making the request is an IP user. * This API should return 'temp' if the user making the request is a temporary account, as described by T358683. What: * Return 'temp' with the value true from the ApiQueryUserInfo API when the user making the API request is a temporary user. * Test that the temp user flag is added when the user making the request is a temporary user and that the flag is not added when the user is logged-out. Bug: T358683 Change-Id: I5f165576a12a2218d89ab3623d7df45e2c9049fa
* tests: Namespace api testsReedy2024-02-181-0/+3
| | | | | Bug: T357823 Change-Id: I0d7cc2c9b166d5e5b913c1305f7cee017fe377af
* tests: Fix @covers and @coversDefaultClass to have leading \Reedy2024-02-161-2/+2
| | | | Change-Id: I5629f91387f2ac453ee4341bfe4bba310bd52f03
* Reorg: Move MWTimestamp to MediaWiki\UtilsAmir Sarabadani2023-08-191-0/+2
| | | | | Bug: T321882 Change-Id: I48c10343295c4eb3d9ef8037343b0070e928f040
* Replace deprecated MWExceptionDaimona Eaytoy2023-06-091-2/+0
| | | | | Bug: T328220 Change-Id: I66be7a6dd752d6b9c254beb65f4eb5ace3c89776
* Add cancreateaccount property to userinfo APIGergő Tisza2022-08-311-0/+33
| | | | | | | | | | | | | | Add a new action=query&meta=userinfo&uiprop=cancreateaccount API property that checks whether the current user is allowed to create accounts. This replaces the functionality removed from list=users&usprop=cancreate in Ie94d61640301192b287275311f345, and makes more sense - list=users is supposed to be about the username (and re-called every time the username in the registration form is changed), while meta=userinfo is about the current user. It's also more accurate: it checks for all things integrated with the permission system. Change-Id: I0006500245a7c2bc3be0310ce9860b5771637a29
* tests/api: Add TestUser::getAuthority and use itUmherirrender2022-08-061-3/+3
| | | | Change-Id: Icfb66f9927c8e67582010a208538b0b5e0ba353f
* Add convenience methods for asserting status.daniel2022-03-161-2/+2
| | | | | | | This ensures that assertions work in a uniform way, and provides meaningful messages in cause of failure. Change-Id: Ic01715b9a55444d3df6b5d4097e78cb8ac082b3e
* Tests: remove unneeded tearDown functionsDannyS7122021-07-271-5/+0
| | | | | | | | No need to manually reset MWTimestamp fake time, MediaWikiTestCaseTrait::fakeTimestampTearDown() does that after all tests anyway. Change-Id: Ie45e837c693d7f21b6c7e25471cdaad6f60a3de9
* Use static closures where safe to useUmherirrender2021-02-111-1/+1
| | | | | | | | | This is micro-optimization of closure code to avoid binding the closure to $this where it is not needed. Created by I25a17fb22b6b669e817317a0f45051ae9c608208 Change-Id: I0ffc6200f6c6693d78a3151cb8cea7dce7c21653
* Use UserEditTracker in ApiQueryUserInfo::getLatestContributionTime()Cindy Cicalese2021-02-071-6/+14
| | | | | Bug: T273788 Change-Id: I5d53fbe84dc3904f042a0f183d8d92b4f9695036
* Add test to ApiQueryUserInfo for latestcontrib timestampCindy Cicalese2021-02-071-0/+49
Bug: T273788 Change-Id: I188402feee3a6ad6cb3198aedbabb5b3ca4d7fb8