From: Erik Bernhardson Date: Thu, 28 Jul 2016 17:15:07 +0000 (-0700) Subject: Rename OpenSearch qiprofile parameter back to profile X-Git-Tag: 1.31.0-rc.0~6235 X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=commitdiff_plain;h=1b13cc1236aebecdea612c73e562c5ac18595e61 Rename OpenSearch qiprofile parameter back to profile 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 --- diff --git a/includes/api/ApiOpenSearch.php b/includes/api/ApiOpenSearch.php index b13ba58653..ace776c923 100644 --- a/includes/api/ApiOpenSearch.php +++ b/includes/api/ApiOpenSearch.php @@ -294,7 +294,7 @@ class ApiOpenSearch extends ApiBase { public function getSearchProfileParams() { return [ - 'qiprofile' => [ + 'profile' => [ 'profile-type' => SearchEngine::COMPLETION_PROFILE_TYPE, 'help-message' => 'apihelp-query+prefixsearch-param-profile' ], diff --git a/tests/phpunit/includes/api/ApiOpenSearchTest.php b/tests/phpunit/includes/api/ApiOpenSearchTest.php index fd5b3a9998..39e90c2e33 100644 --- a/tests/phpunit/includes/api/ApiOpenSearchTest.php +++ b/tests/phpunit/includes/api/ApiOpenSearchTest.php @@ -30,8 +30,8 @@ class ApiOpenSearchTest extends MediaWikiTestCase { $params = $api->getAllowedParams(); $this->assertArrayNotHasKey( 'offset', $params ); - $this->assertArrayHasKey( 'qiprofile', $params, print_r( $params, true ) ); - $this->assertEquals( 'normal', $params['qiprofile'][ApiBase::PARAM_DFLT] ); + $this->assertArrayHasKey( 'profile', $params, print_r( $params, true ) ); + $this->assertEquals( 'normal', $params['profile'][ApiBase::PARAM_DFLT] ); } private function replaceSearchEngineConfig() {