aboutsummaryrefslogtreecommitdiffstats
path: root/tests/phpunit/includes/api/query/ApiQueryRecentChangesIntegrationTest.php
Commit message (Collapse)AuthorAgeFilesLines
* Namespace all remaining files in includes/recentchangesJames D. Forrester2025-03-201-1/+1
| | | | | Bug: T353458 Change-Id: I2ae4577de79832b082adca282ff73cfabc8f9392
* 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
* Filter temporary accounts as anonymous in ApiQueryRecentChangesSTran2024-07-291-8/+40
| | | | | | | | | | | | Edits from temporary accounts are considered anonymous edits. ApiQueryRecentChanges doesn't correctly reflect this and needs to be updated to correctly return temporary account edits as anonymous (and similarly, not to return them when requesting !anon) - Update the anon|!anon query to accomodate temporary accounts Bug: T370803 Change-Id: Ica5225422ea53d2aa3a84b86d9c2f14832a34ed4
* ApiQueryRecentChangesIntegrationTest: Fixes for temp accountsKosta Harlan2024-06-261-2/+3
| | | | | | | | | | | | | | | | | Why: - This test does not pass when temp accounts are enabled What: - Set disableAutoCreateTempUser when doing an anon page edit - Set a valid pattern for the temp user name This patch does not fix testUserPropParameter but does solve the other failures for this class. Bug: T365669 Change-Id: I24b3ff10c6275a9c13c3f07d97ea14581f975067
* Add namespace and deprecation alias to WatchedItemQueryServiceEbrahim Byagowi2024-05-181-1/+1
| | | | | | | | | This patch introduces a namespace declaration for the MediaWiki\Watchlist to WatchedItemQueryService and establishes a class alias marked as deprecated since version 1.43. Bug: T353458 Change-Id: Ib1b5c19c89087940987730939e84c8cd35cd3760
* Update wgAutoCreateTempUser config defaultsDreamy Jazz2024-04-031-15/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Why: * The default value of wgAutoCreateTempUser has not changed since the decision to use a different prefix for temporary accounts (T332805). * The default needs to be updated to reduce the number of overrides in operations/mediawiki-config and also to make the development experience more consistent with what is happening on WMF production. What: * Update the wgAutoCreateTempUser default in the following ways: ** Set expireAfterDays as 365 ** Set notifyBeforeExpirationDays as 10 ** Set genPattern and reservedPattern to '~$1' ** Set matchPattern to null, which will mean that the genPattern is used as the value. * Update RealTempUserConfig::getPlaceholderName to add the year to the placeholder name so that if the match pattern includes the first digit of the year, then the placeholder name still is considered a valid temporary account username. * Replace modifications of the wgAutoCreateTempUser config in integration tests with a use of the TempUserTestTrait to make the code cleaner and make it easier to find tests that relies on the values in wgAutoCreateTempUser. * Update multiple tests to handle the new defaults for the config. Bug: T359335 Change-Id: Ifa5a0123cd915bdb7c87e473c51fb93321622f12
* tests: Namespace api testsReedy2024-02-181-1/+7
| | | | | Bug: T357823 Change-Id: I0d7cc2c9b166d5e5b913c1305f7cee017fe377af
* tests: Fix @covers and @coversDefaultClass to have leading \Reedy2024-02-161-1/+1
| | | | Change-Id: I5629f91387f2ac453ee4341bfe4bba310bd52f03
* Add `temp` flags to api callsSTran2023-12-121-0/+33
| | | | | | | | | | | | Temporary accounts are now distinct from users or anonymous. Add a flag to reflect that to: - ApiQueryImageInfo - ApiQueryLogEvents - ApiQueryRecentChanges - ApiQueryRevisionsBase Bug: T351636 Change-Id: I7986dea5ccd0dc942bf133040c4ac715487f29b9
* Follow-up 71ff05267: Stop writing to tablesUsed in tests, now unnecessaryJames D. Forrester2023-11-211-5/+0
| | | | | Bug: T342301 Change-Id: I5ea01f7ee103570165261bde0965c5b65e04c369
* 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
* Merge "tests: api: Use NS_ constants instead of hard coded values"jenkins-bot2023-07-301-71/+71
|\
| * tests: api: Use NS_ constants instead of hard coded valuesUmherirrender2023-07-291-71/+71
| | | | | | | | | | | | Avoid some "magic" numbers Change-Id: I52ec97434751cfe4136d504a3f8107c6bc63e7ab
* | tests: api: Replace some static function with servicesUmherirrender2023-07-291-17/+14
|/ | | | | | | Replace User::, Title:: ContentHandler:: calls to the corresponding services Change-Id: I57e47221a00eafac9f171215019cf25e19e1808e
* Reorg: Namespace the Title classJames D. Forrester2023-03-021-0/+1
| | | | | | | | | | | | | | | | | | | 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 WikiPage::factoryUmherirrender2022-09-021-3/+3
| | | | | Bug: T297688 Change-Id: Ic84d491c5603f3590e26cb56a305508b2b0ca109
* tests/api: Add TestUser::getAuthority and use itUmherirrender2022-08-061-2/+3
| | | | Change-Id: Icfb66f9927c8e67582010a208538b0b5e0ba353f
* tests/api: Use MediaWikiIntegrationTestCase::editPage for editsUmherirrender2022-08-061-6/+6
| | | | | | | Also improve MediaWikiIntegrationTestCase::editPage by accepting LinkTarget objects and use services instead of static functions Change-Id: I3d036b0837f212d3500159c1d3a3daa4e706882c
* phpunit: use ->getServiceContainer() in integration testsAlexander Vorwerk2022-01-271-3/+2
| | | | Change-Id: I38299cb65eeaadfdc0eb05db4e8c0b0119cfb37d
* tests: Replace usages of deprecated WikiPage::doDeleteArticleRealDaimona Eaytoy2022-01-171-7/+2
| | | | | | | | | Add a new helper to MediaWikiIntegrationTestCase, since deleting pages seems to be pretty common in tests. Some calls to WikiPage::factory were also updated to use WikiPageFactory. Change-Id: I5b5100273a00ac292a1900022ca79708fa254347
* Use WikiPage::doUserEditContent() instead of ::doEditContent()DannyS7122021-06-281-18/+12
| | | | | | | | Results in passing a user where previously the fallback to $wgUser was being used, mostly in tests. Bug: T255507 Change-Id: Iabe24315b23c0ad1272353186425e71974528d23
* RecentChange: replace Title in method signaturesdaniel2021-04-261-1/+0
| | | | | Bug: T278459 Change-Id: I144ea130f29ec437302649d86494034af044c524
* Move ApiQuery* tests under the /query subdirectoryAaron Schulz2020-10-301-0/+1034
Consistency aside, this is useful for grouping more tests into separate threads when using directory based suites. Bug: T50217 Change-Id: Ife9acd5990c4ae4a5fc18371559e93d7d86fb57d