<?php
-use MediaWiki\MediaWikiServices;
-
class ApiOpenSearchTest extends MediaWikiTestCase {
public function testGetAllowedParams() {
$config = $this->replaceSearchEngineConfig();
->method( 'getSearchTypes' )
->will( $this->returnValue( [ 'the one ring' ] ) );
+ $api = $this->createApi();
$engine = $this->replaceSearchEngine();
$engine->expects( $this->any() )
->method( 'getProfiles' )
->will( $this->returnValueMap( [
- [ SearchEngine::COMPLETION_PROFILE_TYPE, [
+ [ SearchEngine::COMPLETION_PROFILE_TYPE, $api->getUser(), [
[
'name' => 'normal',
'desc-message' => 'normal-message',
] ],
] ) );
- $api = $this->createApi();
$params = $api->getAllowedParams();
$this->assertArrayNotHasKey( 'offset', $params );