MediaWiki  REL1_31
SearchEngineTest.php
Go to the documentation of this file.
1 <?php
2 
11 
15  protected $search;
16 
21  protected function setUp() {
22  parent::setUp();
23 
24  // Search tests require MySQL or SQLite with FTS
25  $dbType = $this->db->getType();
26  $dbSupported = ( $dbType === 'mysql' )
27  || ( $dbType === 'sqlite' && $this->db->getFulltextSearchModule() == 'FTS3' );
28 
29  if ( !$dbSupported ) {
30  $this->markTestSkipped( "MySQL or SQLite with FTS3 only" );
31  }
32 
33  $searchType = SearchEngineFactory::getSearchEngineClass( $this->db );
34  $this->setMwGlobals( [
35  'wgSearchType' => $searchType,
36  'wgCapitalLinks' => true,
37  'wgCapitalLinkOverrides' => [
38  NS_CATEGORY => false // for testCompletionSearchMustRespectCapitalLinkOverrides
39  ]
40  ] );
41 
42  $this->search = new $searchType( $this->db );
43  }
44 
45  protected function tearDown() {
46  unset( $this->search );
47 
48  parent::tearDown();
49  }
50 
51  public function addDBDataOnce() {
52  if ( !$this->isWikitextNS( NS_MAIN ) ) {
53  // @todo cover the case of non-wikitext content in the main namespace
54  return;
55  }
56 
57  // Reset the search type back to default - some extensions may have
58  // overridden it.
59  $this->setMwGlobals( [
60  'wgSearchType' => null,
61  'wgCapitalLinks' => true,
62  'wgCapitalLinkOverrides' => [
63  NS_CATEGORY => false // for testCompletionSearchMustRespectCapitalLinkOverrides
64  ]
65  ] );
66 
67  $this->insertPage( 'Not_Main_Page', 'This is not a main page' );
68  $this->insertPage(
69  'Talk:Not_Main_Page',
70  'This is not a talk page to the main page, see [[smithee]]'
71  );
72  $this->insertPage( 'Smithee', 'A smithee is one who smiths. See also [[Alan Smithee]]' );
73  $this->insertPage( 'Talk:Smithee', 'This article sucks.' );
74  $this->insertPage( 'Unrelated_page', 'Nothing in this page is about the S word.' );
75  $this->insertPage( 'Another_page', 'This page also is unrelated.' );
76  $this->insertPage( 'Help:Help', 'Help me!' );
77  $this->insertPage( 'Thppt', 'Blah blah' );
78  $this->insertPage( 'Alan_Smithee', 'yum' );
79  $this->insertPage( 'Pages', 'are\'food' );
80  $this->insertPage( 'HalfOneUp', 'AZ' );
81  $this->insertPage( 'FullOneUp', 'AZ' );
82  $this->insertPage( 'HalfTwoLow', 'az' );
83  $this->insertPage( 'FullTwoLow', 'az' );
84  $this->insertPage( 'HalfNumbers', '1234567890' );
85  $this->insertPage( 'FullNumbers', '1234567890' );
86  $this->insertPage( 'DomainName', 'example.com' );
87  $this->insertPage( 'DomainName', 'example.com' );
88  $this->insertPage( 'Category:search is not Search', '' );
89  $this->insertPage( 'Category:Search is not search', '' );
90  }
91 
92  protected function fetchIds( $results ) {
93  if ( !$this->isWikitextNS( NS_MAIN ) ) {
94  $this->markTestIncomplete( __CLASS__ . " does no yet support non-wikitext content "
95  . "in the main namespace" );
96  }
97  $this->assertTrue( is_object( $results ) );
98 
99  $matches = [];
100  $row = $results->next();
101  while ( $row ) {
102  $matches[] = $row->getTitle()->getPrefixedText();
103  $row = $results->next();
104  }
105  $results->free();
106  # Search is not guaranteed to return results in a certain order;
107  # sort them numerically so we will compare simply that we received
108  # the expected matches.
109  sort( $matches );
110 
111  return $matches;
112  }
113 
114  public function testFullWidth() {
115  $this->assertEquals(
116  [ 'FullOneUp', 'FullTwoLow', 'HalfOneUp', 'HalfTwoLow' ],
117  $this->fetchIds( $this->search->searchText( 'AZ' ) ),
118  "Search for normalized from Half-width Upper" );
119  $this->assertEquals(
120  [ 'FullOneUp', 'FullTwoLow', 'HalfOneUp', 'HalfTwoLow' ],
121  $this->fetchIds( $this->search->searchText( 'az' ) ),
122  "Search for normalized from Half-width Lower" );
123  $this->assertEquals(
124  [ 'FullOneUp', 'FullTwoLow', 'HalfOneUp', 'HalfTwoLow' ],
125  $this->fetchIds( $this->search->searchText( 'AZ' ) ),
126  "Search for normalized from Full-width Upper" );
127  $this->assertEquals(
128  [ 'FullOneUp', 'FullTwoLow', 'HalfOneUp', 'HalfTwoLow' ],
129  $this->fetchIds( $this->search->searchText( 'az' ) ),
130  "Search for normalized from Full-width Lower" );
131  }
132 
133  public function testTextSearch() {
134  $this->assertEquals(
135  [ 'Smithee' ],
136  $this->fetchIds( $this->search->searchText( 'smithee' ) ),
137  "Plain search" );
138  }
139 
140  public function testWildcardSearch() {
141  $res = $this->search->searchText( 'smith*' );
142  $this->assertEquals(
143  [ 'Smithee' ],
144  $this->fetchIds( $res ),
145  "Search with wildcards" );
146 
147  $res = $this->search->searchText( 'smithson*' );
148  $this->assertEquals(
149  [],
150  $this->fetchIds( $res ),
151  "Search with wildcards must not find unrelated articles" );
152 
153  $res = $this->search->searchText( 'smith* smithee' );
154  $this->assertEquals(
155  [ 'Smithee' ],
156  $this->fetchIds( $res ),
157  "Search with wildcards can be combined with simple terms" );
158 
159  $res = $this->search->searchText( 'smith* "one who smiths"' );
160  $this->assertEquals(
161  [ 'Smithee' ],
162  $this->fetchIds( $res ),
163  "Search with wildcards can be combined with phrase search" );
164  }
165 
166  public function testPhraseSearch() {
167  $res = $this->search->searchText( '"smithee is one who smiths"' );
168  $this->assertEquals(
169  [ 'Smithee' ],
170  $this->fetchIds( $res ),
171  "Search a phrase" );
172 
173  $res = $this->search->searchText( '"smithee is who smiths"' );
174  $this->assertEquals(
175  [],
176  $this->fetchIds( $res ),
177  "Phrase search is not sloppy, search terms must be adjacent" );
178 
179  $res = $this->search->searchText( '"is smithee one who smiths"' );
180  $this->assertEquals(
181  [],
182  $this->fetchIds( $res ),
183  "Phrase search is ordered" );
184  }
185 
186  public function testPhraseSearchHighlight() {
187  $phrase = "smithee is one who smiths";
188  $res = $this->search->searchText( "\"$phrase\"" );
189  $match = $res->next();
190  $snippet = "A <span class='searchmatch'>" . $phrase . "</span>";
191  $this->assertStringStartsWith( $snippet,
192  $match->getTextSnippet( $res->termMatches() ),
193  "Highlight a phrase search" );
194  }
195 
196  public function testTextPowerSearch() {
197  $this->search->setNamespaces( [ 0, 1, 4 ] );
198  $this->assertEquals(
199  [
200  'Smithee',
201  'Talk:Not Main Page',
202  ],
203  $this->fetchIds( $this->search->searchText( 'smithee' ) ),
204  "Power search" );
205  }
206 
207  public function testTitleSearch() {
208  $this->assertEquals(
209  [
210  'Alan Smithee',
211  'Smithee',
212  ],
213  $this->fetchIds( $this->search->searchTitle( 'smithee' ) ),
214  "Title search" );
215  }
216 
217  public function testTextTitlePowerSearch() {
218  $this->search->setNamespaces( [ 0, 1, 4 ] );
219  $this->assertEquals(
220  [
221  'Alan Smithee',
222  'Smithee',
223  'Talk:Smithee',
224  ],
225  $this->fetchIds( $this->search->searchTitle( 'smithee' ) ),
226  "Title power search" );
227  }
228 
230  return [
231  'Searching for "smithee" finds Smithee on NS_MAIN' => [
232  'smithee',
233  'Smithee',
234  [ NS_MAIN ],
235  ],
236  'Searching for "search is" will finds "search is not Search" on NS_CATEGORY' => [
237  'search is',
238  'Category:search is not Search',
239  [ NS_CATEGORY ],
240  ],
241  'Searching for "Search is" will finds "search is not Search" on NS_CATEGORY' => [
242  'Search is',
243  'Category:Search is not search',
244  [ NS_CATEGORY ],
245  ],
246  ];
247  }
248 
261  $search,
262  $expectedSuggestion,
264  ) {
265  $this->search->setNamespaces( $namespaces );
266  $results = $this->search->completionSearch( $search );
267  $this->assertEquals( 1, $results->getSize() );
268  $this->assertEquals( $expectedSuggestion, $results->getSuggestions()[0]->getText() );
269  }
270 
274  public function testSearchIndexFields() {
278  $mockEngine = $this->getMockBuilder( SearchEngine::class )
279  ->setMethods( [ 'makeSearchFieldMapping' ] )->getMock();
280 
281  $mockFieldBuilder = function ( $name, $type ) {
282  $mockField =
283  $this->getMockBuilder( SearchIndexFieldDefinition::class )->setConstructorArgs( [
284  $name,
285  $type
286  ] )->getMock();
287 
288  $mockField->expects( $this->any() )->method( 'getMapping' )->willReturn( [
289  'testData' => 'test',
290  'name' => $name,
291  'type' => $type,
292  ] );
293 
294  $mockField->expects( $this->any() )
295  ->method( 'merge' )
296  ->willReturn( $mockField );
297 
298  return $mockField;
299  };
300 
301  $mockEngine->expects( $this->atLeastOnce() )
302  ->method( 'makeSearchFieldMapping' )
303  ->willReturnCallback( $mockFieldBuilder );
304 
305  // Not using mock since PHPUnit mocks do not work properly with references in params
306  $this->setTemporaryHook( 'SearchIndexFields',
307  function ( &$fields, SearchEngine $engine ) use ( $mockFieldBuilder ) {
308  $fields['testField'] =
309  $mockFieldBuilder( "testField", SearchIndexField::INDEX_TYPE_TEXT );
310  return true;
311  } );
312 
313  $fields = $mockEngine->getSearchIndexFields();
314  $this->assertArrayHasKey( 'language', $fields );
315  $this->assertArrayHasKey( 'category', $fields );
316  $this->assertInstanceOf( SearchIndexField::class, $fields['testField'] );
317 
318  $mapping = $fields['testField']->getMapping( $mockEngine );
319  $this->assertArrayHasKey( 'testData', $mapping );
320  $this->assertEquals( 'test', $mapping['testData'] );
321  }
322 
323  public function hookSearchIndexFields( $mockFieldBuilder, &$fields, SearchEngine $engine ) {
324  $fields['testField'] = $mockFieldBuilder( "testField", SearchIndexField::INDEX_TYPE_TEXT );
325  return true;
326  }
327 
328  public function testAugmentorSearch() {
329  $this->search->setNamespaces( [ 0, 1, 4 ] );
330  $resultSet = $this->search->searchText( 'smithee' );
331  // Not using mock since PHPUnit mocks do not work properly with references in params
332  $this->mergeMwGlobalArrayValue( 'wgHooks',
333  [ 'SearchResultsAugment' => [ [ $this, 'addAugmentors' ] ] ] );
334  $this->search->augmentSearchResults( $resultSet );
335  for ( $result = $resultSet->next(); $result; $result = $resultSet->next() ) {
336  $id = $result->getTitle()->getArticleID();
337  $augmentData = "Result:$id:" . $result->getTitle()->getText();
338  $augmentData2 = "Result2:$id:" . $result->getTitle()->getText();
339  $this->assertEquals( [ 'testSet' => $augmentData, 'testRow' => $augmentData2 ],
340  $result->getExtensionData() );
341  }
342  }
343 
344  public function addAugmentors( &$setAugmentors, &$rowAugmentors ) {
345  $setAugmentor = $this->createMock( ResultSetAugmentor::class );
346  $setAugmentor->expects( $this->once() )
347  ->method( 'augmentAll' )
348  ->willReturnCallback( function ( SearchResultSet $resultSet ) {
349  $data = [];
350  for ( $result = $resultSet->next(); $result; $result = $resultSet->next() ) {
351  $id = $result->getTitle()->getArticleID();
352  $data[$id] = "Result:$id:" . $result->getTitle()->getText();
353  }
354  $resultSet->rewind();
355  return $data;
356  } );
357  $setAugmentors['testSet'] = $setAugmentor;
358 
359  $rowAugmentor = $this->createMock( ResultAugmentor::class );
360  $rowAugmentor->expects( $this->exactly( 2 ) )
361  ->method( 'augment' )
362  ->willReturnCallback( function ( SearchResult $result ) {
363  $id = $result->getTitle()->getArticleID();
364  return "Result2:$id:" . $result->getTitle()->getText();
365  } );
366  $rowAugmentors['testRow'] = $rowAugmentor;
367  }
368 }
SearchEngineTest\testSearchIndexFields
testSearchIndexFields()
SearchEngine::getSearchIndexFields.
Definition: SearchEngineTest.php:274
SearchEngineTest\tearDown
tearDown()
Definition: SearchEngineTest.php:45
use
Apache License January AND DISTRIBUTION Definitions License shall mean the terms and conditions for use
Definition: APACHE-LICENSE-2.0.txt:10
MediaWikiTestCase\mergeMwGlobalArrayValue
mergeMwGlobalArrayValue( $name, $values)
Merges the given values into a MW global array variable.
Definition: MediaWikiTestCase.php:813
SearchEngineTest
Search Database.
Definition: SearchEngineTest.php:10
SearchEngineTest\testTextSearch
testTextSearch()
Definition: SearchEngineTest.php:133
array
the array() calling protocol came about after MediaWiki 1.4rc1.
SearchEngineTest\testPhraseSearchHighlight
testPhraseSearchHighlight()
Definition: SearchEngineTest.php:186
SearchEngineTest\testPhraseSearch
testPhraseSearch()
Definition: SearchEngineTest.php:166
MediaWikiTestCase\isWikitextNS
isWikitextNS( $ns)
Returns true if the given namespace defaults to Wikitext according to $wgNamespaceContentModels.
Definition: MediaWikiTestCase.php:1895
SearchResultSet\rewind
rewind()
Rewind result set back to beginning.
Definition: SearchResultSet.php:185
$rowAugmentors
the value to return A Title object or null for latest all implement SearchIndexField must implement ResultSetAugmentor & $rowAugmentors
Definition: hooks.txt:2882
SearchEngineTest\testWildcardSearch
testWildcardSearch()
Definition: SearchEngineTest.php:140
SearchEngineTest\testAugmentorSearch
testAugmentorSearch()
Definition: SearchEngineTest.php:328
SearchEngineTest\testFullWidth
testFullWidth()
Definition: SearchEngineTest.php:114
$res
$res
Definition: database.txt:21
SearchEngineTest\provideCompletionSearchMustRespectCapitalLinkOverrides
provideCompletionSearchMustRespectCapitalLinkOverrides()
Definition: SearchEngineTest.php:229
$result
The index of the header message $result[1]=The index of the body text message $result[2 through n]=Parameters passed to body text message. Please note the header message cannot receive/use parameters. 'ImgAuthModifyHeaders':Executed just before a file is streamed to a user via img_auth.php, allowing headers to be modified beforehand. $title:LinkTarget object & $headers:HTTP headers(name=> value, names are case insensitive). Two headers get special handling:If-Modified-Since(value must be a valid HTTP date) and Range(must be of the form "bytes=(\d*-\d*)") will be honored when streaming the file. 'ImportHandleLogItemXMLTag':When parsing a XML tag in a log item. Return false to stop further processing of the tag $reader:XMLReader object $logInfo:Array of information 'ImportHandlePageXMLTag':When parsing a XML tag in a page. Return false to stop further processing of the tag $reader:XMLReader object & $pageInfo:Array of information 'ImportHandleRevisionXMLTag':When parsing a XML tag in a page revision. Return false to stop further processing of the tag $reader:XMLReader object $pageInfo:Array of page information $revisionInfo:Array of revision information 'ImportHandleToplevelXMLTag':When parsing a top level XML tag. Return false to stop further processing of the tag $reader:XMLReader object 'ImportHandleUnknownUser':When a user doesn 't exist locally, this hook is called to give extensions an opportunity to auto-create it. If the auto-creation is successful, return false. $name:User name 'ImportHandleUploadXMLTag':When parsing a XML tag in a file upload. Return false to stop further processing of the tag $reader:XMLReader object $revisionInfo:Array of information 'ImportLogInterwikiLink':Hook to change the interwiki link used in log entries and edit summaries for transwiki imports. & $fullInterwikiPrefix:Interwiki prefix, may contain colons. & $pageTitle:String that contains page title. 'ImportSources':Called when reading from the $wgImportSources configuration variable. Can be used to lazy-load the import sources list. & $importSources:The value of $wgImportSources. Modify as necessary. See the comment in DefaultSettings.php for the detail of how to structure this array. 'InfoAction':When building information to display on the action=info page. $context:IContextSource object & $pageInfo:Array of information 'InitializeArticleMaybeRedirect':MediaWiki check to see if title is a redirect. & $title:Title object for the current page & $request:WebRequest & $ignoreRedirect:boolean to skip redirect check & $target:Title/string of redirect target & $article:Article object 'InternalParseBeforeLinks':during Parser 's internalParse method before links but after nowiki/noinclude/includeonly/onlyinclude and other processings. & $parser:Parser object & $text:string containing partially parsed text & $stripState:Parser 's internal StripState object 'InternalParseBeforeSanitize':during Parser 's internalParse method just before the parser removes unwanted/dangerous HTML tags and after nowiki/noinclude/includeonly/onlyinclude and other processings. Ideal for syntax-extensions after template/parser function execution which respect nowiki and HTML-comments. & $parser:Parser object & $text:string containing partially parsed text & $stripState:Parser 's internal StripState object 'InterwikiLoadPrefix':When resolving if a given prefix is an interwiki or not. Return true without providing an interwiki to continue interwiki search. $prefix:interwiki prefix we are looking for. & $iwData:output array describing the interwiki with keys iw_url, iw_local, iw_trans and optionally iw_api and iw_wikiid. 'InvalidateEmailComplete':Called after a user 's email has been invalidated successfully. $user:user(object) whose email is being invalidated 'IRCLineURL':When constructing the URL to use in an IRC notification. Callee may modify $url and $query, URL will be constructed as $url . $query & $url:URL to index.php & $query:Query string $rc:RecentChange object that triggered url generation 'IsFileCacheable':Override the result of Article::isFileCacheable()(if true) & $article:article(object) being checked 'IsTrustedProxy':Override the result of IP::isTrustedProxy() & $ip:IP being check & $result:Change this value to override the result of IP::isTrustedProxy() 'IsUploadAllowedFromUrl':Override the result of UploadFromUrl::isAllowedUrl() $url:URL used to upload from & $allowed:Boolean indicating if uploading is allowed for given URL 'isValidEmailAddr':Override the result of Sanitizer::validateEmail(), for instance to return false if the domain name doesn 't match your organization. $addr:The e-mail address entered by the user & $result:Set this and return false to override the internal checks 'isValidPassword':Override the result of User::isValidPassword() $password:The password entered by the user & $result:Set this and return false to override the internal checks $user:User the password is being validated for 'Language::getMessagesFileName':$code:The language code or the language we 're looking for a messages file for & $file:The messages file path, you can override this to change the location. 'LanguageGetMagic':DEPRECATED! Use $magicWords in a file listed in $wgExtensionMessagesFiles instead. Use this to define synonyms of magic words depending of the language & $magicExtensions:associative array of magic words synonyms $lang:language code(string) 'LanguageGetNamespaces':Provide custom ordering for namespaces or remove namespaces. Do not use this hook to add namespaces. Use CanonicalNamespaces for that. & $namespaces:Array of namespaces indexed by their numbers 'LanguageGetSpecialPageAliases':DEPRECATED! Use $specialPageAliases in a file listed in $wgExtensionMessagesFiles instead. Use to define aliases of special pages names depending of the language & $specialPageAliases:associative array of magic words synonyms $lang:language code(string) 'LanguageGetTranslatedLanguageNames':Provide translated language names. & $names:array of language code=> language name $code:language of the preferred translations 'LanguageLinks':Manipulate a page 's language links. This is called in various places to allow extensions to define the effective language links for a page. $title:The page 's Title. & $links:Array with elements of the form "language:title" in the order that they will be output. & $linkFlags:Associative array mapping prefixed links to arrays of flags. Currently unused, but planned to provide support for marking individual language links in the UI, e.g. for featured articles. 'LanguageSelector':Hook to change the language selector available on a page. $out:The output page. $cssClassName:CSS class name of the language selector. 'LinkBegin':DEPRECATED! Use HtmlPageLinkRendererBegin instead. Used when generating internal and interwiki links in Linker::link(), before processing starts. Return false to skip default processing and return $ret. See documentation for Linker::link() for details on the expected meanings of parameters. $skin:the Skin object $target:the Title that the link is pointing to & $html:the contents that the< a > tag should have(raw HTML) $result
Definition: hooks.txt:1993
php
injection txt This is an overview of how MediaWiki makes use of dependency injection The design described here grew from the discussion of RFC T384 The term dependency this means that anything an object needs to operate should be injected from the the object itself should only know narrow no concrete implementation of the logic it relies on The requirement to inject everything typically results in an architecture that based on two main types of and essentially stateless service objects that use other service objects to operate on the value objects As of the beginning MediaWiki is only starting to use the DI approach Much of the code still relies on global state or direct resulting in a highly cyclical dependency which acts as the top level factory for services in MediaWiki which can be used to gain access to default instances of various services MediaWikiServices however also allows new services to be defined and default services to be redefined Services are defined or redefined by providing a callback the instantiator that will return a new instance of the service When it will create an instance of MediaWikiServices and populate it with the services defined in the files listed by thereby bootstrapping the DI framework Per $wgServiceWiringFiles lists includes ServiceWiring php
Definition: injection.txt:37
NS_MAIN
const NS_MAIN
Definition: Defines.php:74
SearchEngineTest\$search
SearchEngine $search
Definition: SearchEngineTest.php:15
SearchEngineTest\addDBDataOnce
addDBDataOnce()
Stub.
Definition: SearchEngineTest.php:51
SearchResult
Definition: SearchResult.php:32
SearchEngineTest\testCompletionSearchMustRespectCapitalLinkOverrides
testCompletionSearchMustRespectCapitalLinkOverrides( $search, $expectedSuggestion, array $namespaces)
Test that the search query is not munged using wrong CapitalLinks setup (in other test that the defau...
Definition: SearchEngineTest.php:260
SearchEngineTest\fetchIds
fetchIds( $results)
Definition: SearchEngineTest.php:92
MediaWikiTestCase\setMwGlobals
setMwGlobals( $pairs, $value=null)
Sets a global, maintaining a stashed version of the previous global to be restored in tearDown.
Definition: MediaWikiTestCase.php:678
$matches
$matches
Definition: NoLocalSettings.php:24
SearchEngineTest\testTextTitlePowerSearch
testTextTitlePowerSearch()
Definition: SearchEngineTest.php:217
SearchEngineFactory\getSearchEngineClass
static getSearchEngineClass(IDatabase $db)
Definition: SearchEngineFactory.php:49
SearchResultSet
Definition: SearchResultSet.php:27
NS_CATEGORY
const NS_CATEGORY
Definition: Defines.php:88
SearchEngineTest\testTitleSearch
testTitleSearch()
Definition: SearchEngineTest.php:207
SearchEngineTest\addAugmentors
addAugmentors(&$setAugmentors, &$rowAugmentors)
Definition: SearchEngineTest.php:344
MediaWikiLangTestCase
Base class that store and restore the Language objects.
Definition: MediaWikiLangTestCase.php:6
$engine
the value to return A Title object or null for latest all implement SearchIndexField $engine
Definition: hooks.txt:2881
SearchEngine
Contain a class for special pages.
Definition: SearchEngine.php:34
$name
Allows to change the fields on the form that will be generated $name
Definition: hooks.txt:302
SearchResultSet\next
next()
Fetches next search result, or false.
Definition: SearchResultSet.php:178
$namespaces
namespace and then decline to actually register it & $namespaces
Definition: hooks.txt:934
MediaWikiTestCase\insertPage
insertPage( $pageName, $text='Sample page for unit test.', $namespace=null)
Insert a new page.
Definition: MediaWikiTestCase.php:1033
SearchEngineTest\hookSearchIndexFields
hookSearchIndexFields( $mockFieldBuilder, &$fields, SearchEngine $engine)
Definition: SearchEngineTest.php:323
class
you have access to all of the normal MediaWiki so you can get a DB use the etc For full docs on the Maintenance class
Definition: maintenance.txt:56
MediaWikiTestCase\setTemporaryHook
setTemporaryHook( $hookName, $handler)
Create a temporary hook handler which will be reset by tearDown.
Definition: MediaWikiTestCase.php:2014
SearchEngineTest\testTextPowerSearch
testTextPowerSearch()
Definition: SearchEngineTest.php:196
SearchEngineTest\setUp
setUp()
Checks for database type & version.
Definition: SearchEngineTest.php:21
SearchIndexField\INDEX_TYPE_TEXT
const INDEX_TYPE_TEXT
Field types.
Definition: SearchIndexField.php:10
$type
$type
Definition: testCompression.php:48