10 'empty search result' => [ [], [] ],
11 'has search results' => [
15 'filters broken search results' => [
23 'filters results with missing revision' => [
42 'srsearch' =>
'my query',
45 foreach (
$response[
'query'][
'search'] as $result ) {
48 $this->assertEquals( $expect,
$titles );
53 'empty' => [ [], [] ],
54 'one wiki response' => [
55 [
'utwiki' => [
'Qwerty' ] ],
57 SearchResultSet::SECONDARY_RESULTS => [
61 [
'setInterwikiPrefix' =>
'utwiki' ]
78 'srsearch' =>
'my query',
79 'srinterwiki' =>
true,
82 $this->assertArrayNotHasKey(
'interwikisearch',
$response[
'query'] );
86 $this->assertArrayHasKey(
'interwikisearchinfo',
$response[
'query'] );
87 foreach (
$response[
'query'][
'interwikisearch'] as $wiki => $wikiResults ) {
89 foreach ( $wikiResults as $wikiResult ) {
90 $results[$wiki][] = $wikiResult[
'title'];
93 $this->assertEquals( $expect, $results );
104 'wgSearchType' => MockSearchEngine::class,
121 return function () use ( $title, $setters ){
124 foreach ( $setters as $method => $param ) {
125 $result->$method( $param );
testSearchResults( $expect, $hits, array $params=[])
provideSearchResults
mockResultClosure( $title, $setters=[])
Returns a closure that evaluates to a MockSearchResult, to be resolved by MockSearchEngine::addMockRe...
registerMockSearchEngine()
provideInterwikiResults()
testInterwikiResults( $expect, $hits, array $params=[])
provideInterwikiResults
doApiRequest(array $params, array $session=null, $appendModule=false, User $user=null, $tokenType=null)
Does the API request and returns the result.
static setMockInterwikiResults(array $interwikiResults)
static clearMockResults()
static addMockResults( $query, array $results)
static newFromTitle( $title, SearchResultSet $parentSet=null)
Return a new SearchResult and initializes it with a title.
deferred txt A few of the database updates required by various functions here can be deferred until after the result page is displayed to the user For updating the view updating the linked to tables after a etc PHP does not yet have any way to tell the server to actually return and disconnect while still running these but it might have such a feature in the future We handle these by creating a deferred update object and putting those objects on a global list
namespace being checked & $result
do that in ParserLimitReportFormat instead use this to modify the parameters of the image all existing parser cache entries will be invalid To avoid you ll need to handle that somehow(e.g. with the RejectParserCacheValue hook) because MediaWiki won 't do it for you. & $defaults also a ContextSource after deleting those rows but within the same transaction you ll probably need to make sure the header is varied on $request
this hook is for auditing only $response
linkcache txt The LinkCache class maintains a list of article titles and the information about whether or not the article exists in the database This is used to mark up links when displaying a page If the same link appears more than once on any page then it only has to be looked up once In most cases link lookups are done in batches with the LinkBatch class or the equivalent in so the link cache is mostly useful for short snippets of parsed and for links in the navigation areas of the skin The link cache was formerly used to track links used in a document for the purposes of updating the link tables This application is now deprecated To create a you can use the following $titles
The wiki should then use memcached to cache various data To use multiple just add more items to the array To increase the weight of a make its entry a array("192.168.0.1:11211", 2))