aboutsummaryrefslogtreecommitdiffstats
path: root/tests/phpunit/includes/api/ApiOpenSearchTest.php
Commit message (Collapse)AuthorAgeFilesLines
* Add namespace to includes/api classesJames D. Forrester2024-09-251-3/+3
| | | | | Bug: T353458 Change-Id: I3ea6b08c5018ba03ba45c5766e1f46e12f6b8597
* tests: Namespace api testsReedy2024-02-181-0/+8
| | | | | Bug: T357823 Change-Id: I0d7cc2c9b166d5e5b913c1305f7cee017fe377af
* tests: Fix @covers and @coversDefaultClass to have leading \Reedy2024-02-161-1/+1
| | | | Change-Id: I5629f91387f2ac453ee4341bfe4bba310bd52f03
* Namespace includes/contextJames D. Forrester2024-02-081-0/+1
| | | | | Bug: T353458 Change-Id: I4dbef138fd0110c14c70214282519189d70c94fb
* API: Replace deprecated calls to wfExpandUrl with UrlUtils::expandJames D. Forrester2023-06-221-1/+2
| | | | | Bug: T319340 Change-Id: Ic987f9381ac17e9e46504abdb2d07a5a94ba3b4a
* Use short array destructuring instead of list()Tim Starling2022-10-211-1/+1
| | | | | | | | Introduced in PHP 7.1. Because it's shorter and looks nice. I used regex replacement. Change-Id: I0555e199d126cd44501f859cb4589f8bd49694da
* Replace trivial usa of mock builder with createMock() shortcutThiemo Kreuz2022-07-151-9/+3
| | | | | | | | | | | createMock() does the same, but is much easier to read. A small difference is that some of the replacements made in this patch didn't use disableOriginalConstructor() before. In case this was relevant we should see the respective test fail. If not we can save some CPU cycles and skip these constructors. Change-Id: Ib98fb06e0fe753b7a53cb087a47e1159515a8ad5
* Merge "api: Replace numerous deprecated constants"jenkins-bot2022-06-061-1/+3
|\
| * api: Replace numerous deprecated constantsReedy2022-06-061-1/+3
| | | | | | | | Change-Id: I34ffcb70efbfa257da8dab6e0790aa0d697caf5b
* | Tests: Cleanup some unnecessary nested function callsReedy2022-06-061-2/+2
|/ | | | | | Replace ->will( ->return with ->willReturn( Change-Id: Ia2dfafa03cac8169d86d6fa5a30b73bfad1fe9fa
* Inject dependencies into SearchApiDannyS7122021-07-041-9/+15
| | | | | | | | | | | | | Used in api classes where services can be injected, no need to rely on MediaWikiServices Will make it possible to convert ApiOpenSearchTest to a unit test, since everything is injected, but that will be done in a follow-up Plus some minor cleanup to SearchApi Change-Id: If0a3a60f1ead897947143b57d98a3a506387f6d5
* api: Inject services into ApiOpenSearchUmherirrender2021-06-291-1/+1
| | | | | Bug: T259960 Change-Id: Iaf834da5aad020fbfc2850ff786b23c134717a01
* Remove meaningless ->expects( $this->any() ) from all testsThiemo Kreuz2021-04-231-2/+1
| | | | | | | | | | | | | | | It is not entirely meaningless. It might be an indicator that the number of calls to a method is intentionally unlimited. This is similar to e.g. an @inheritDoc PHPDoc comment that marks a method as being "intentionally undocumented". However, what's the meaning of being "intentionally unconstrained"? Let's just not have any constraint then. I feel all these ->expects( $this->any() ) bloat the test code so much that it's never worth it. Change-Id: I9925e7706bd03e1666f6eb0b284cb42b0dd3be23
* Replace PHPUnit ->returnValue() with ->willReturn() shortcutThiemo Kreuz2021-04-221-6/+4
| | | | | | | | | | | | It's the same and makes the test code much more readable, I would like to argue. Because of the was I split all the changes I made into smaller patches this patch contains some other changes in the same lines where I could not split them off. E.g. removal of ->any(), which is the default anyway and doesn't do anything. Change-Id: Ib297b989d4aec33b31a4e33fe9d5032865b39be0
* MediaWikiTestCase to MediaWikiIntegrationTestCaseaddshore2020-06-301-1/+1
| | | | | | | | | | | | | The name change happened some time ago, and I think its about time to start using the name name! (Done with a find and replace) My personal motivation for doing this is that I have started trying out vscode as an IDE for mediawiki development, and right now it doesn't appear to handle php aliases very well or at all. Change-Id: I412235d91ae26e4c1c6a62e0dbb7e7cf3c5ed4a6
* Use ::class to resolve class names in testsUmherirrender2018-01-261-3/+3
| | | | | | | This helps to find renamed or misspelled classes earlier. Phan will check the class names Change-Id: Ie541a7baae10ab6f5c13f95ac2ff6598b8f8950c
* Add @covers tags API tests without themKunal Mehta2017-12-271-0/+3
| | | | Change-Id: Ida0f954cb0a44719af3a3d0c6bda4587c9ca42b6
* Remove unused imports from test classesThiemo Mättig2017-01-101-2/+0
| | | | | | | Validating this should be as simple as it can be: if the tests run, this change should be fine. :-) Change-Id: I8e4a3dfc83fdc9b8c8d7f5bbd067e088ebd2133d
* Pass User to SearchEngine::getProfilesdcausse2016-09-201-2/+2
| | | | | | | Useful for search engines that allow users to customize search profiles. Depends-On: Icd577c8ebc6e162befe30bde4fe276e633d2e434 Change-Id: I471cd090730d2a25cb70d622ec3bebbe9583118c
* Rename OpenSearch qiprofile parameter back to profileErik Bernhardson2016-07-281-2/+2
| | | | | | | | | | In I6f987db this parameter was inadvertantly renamed to qiprofile. The qiprofile is something different, and is also a BC break. The BC break is pretty minor, for a randomly chosen day this looks to be used 157 times out of 28.7M requests, but since this really isn't a qiprofile rename it back to what it was. Change-Id: I1cc07945888c15ea4b4c9596eea447b706606fae
* Push common search api parameters into SearchApi classErik Bernhardson2016-07-261-0/+66
We have a number of parameters that are pretty much the same between these different search api's. Lets make them actually the same by sharing the definitions, and then letting individual classes tweak them as needed by removing the offset, or adjusting the max limits as necessary. Change-Id: I6f987db8ecb63dc943b4d2518bfe3703c677448e