aboutsummaryrefslogtreecommitdiffstats
path: root/tests/phpunit/includes/api/ApiOpenSearchTest.php
diff options
context:
space:
mode:
authorThiemo Kreuz <thiemo.kreuz@wikimedia.de>2021-04-22 10:40:46 +0200
committerThiemo Kreuz <thiemo.kreuz@wikimedia.de>2021-04-23 11:58:58 +0200
commitb95a07380a64e72581a8bf41f466f58a1901ecb1 (patch)
treec4c271c16b01c10685f4bef807b71d1e2a41bf2d /tests/phpunit/includes/api/ApiOpenSearchTest.php
parent791aa5e30666ab10736266e1d04c506aec771d96 (diff)
downloadmediawikicore-b95a07380a64e72581a8bf41f466f58a1901ecb1.tar.gz
mediawikicore-b95a07380a64e72581a8bf41f466f58a1901ecb1.zip
Remove meaningless ->expects( $this->any() ) from all tests
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
Diffstat (limited to 'tests/phpunit/includes/api/ApiOpenSearchTest.php')
-rw-r--r--tests/phpunit/includes/api/ApiOpenSearchTest.php3
1 files changed, 1 insertions, 2 deletions
diff --git a/tests/phpunit/includes/api/ApiOpenSearchTest.php b/tests/phpunit/includes/api/ApiOpenSearchTest.php
index 68df7afeb393..05dfa4c1f5c2 100644
--- a/tests/phpunit/includes/api/ApiOpenSearchTest.php
+++ b/tests/phpunit/includes/api/ApiOpenSearchTest.php
@@ -11,8 +11,7 @@ class ApiOpenSearchTest extends MediaWikiIntegrationTestCase {
$api = $this->createApi();
$engine = $this->replaceSearchEngine();
- $engine->expects( $this->any() )
- ->method( 'getProfiles' )
+ $engine->method( 'getProfiles' )
->will( $this->returnValueMap( [
[ SearchEngine::COMPLETION_PROFILE_TYPE, $api->getUser(), [
[