MediaWiki  master
SearchEngineTest Class Reference

Search Database. More...

Inheritance diagram for SearchEngineTest:
Collaboration diagram for SearchEngineTest:

Public Member Functions

 addAugmentors (&$setAugmentors, &$rowAugmentors)
 
 addDBDataOnce ()
 
 hookSearchIndexFields ( $mockFieldBuilder, &$fields, SearchEngine $engine)
 
 provideCompletionSearchMustRespectCapitalLinkOverrides ()
 
 provideDataForParseNamespacePrefix ()
 
 testAugmentorSearch ()
 
 testCompletionSearchMustRespectCapitalLinkOverrides ( $search, $expectedSuggestion, array $namespaces)
 Test that the search query is not munged using wrong CapitalLinks setup (in other test that the default search backend can benefit from wgCapitalLinksOverride) Guard against regressions like T208255 provideCompletionSearchMustRespectCapitalLinkOverrides SearchEngine::completionSearch PrefixSearch::defaultSearchBackend. More...
 
 testFiltersMissing ()
 
 testFullWidth ()
 
 testParseNamespacePrefix (array $params, $expected)
 provideDataForParseNamespacePrefix More...
 
 testPhraseSearch ()
 
 testPhraseSearchHighlight ()
 
 testSearchIndexFields ()
 SearchEngine::getSearchIndexFields. More...
 
 testTextPowerSearch ()
 
 testTextSearch ()
 
 testTextTitlePowerSearch ()
 
 testTitleSearch ()
 
 testWildcardSearch ()
 

Protected Member Functions

 fetchIds ( $results)
 
 setUp ()
 Checks for database type & version. More...
 
 tearDown ()
 
- Protected Member Functions inherited from MediaWikiLangTestCase
 setUp ()
 

Protected Attributes

SearchEngine $search
 

Private Member Functions

 editSearchResultPage ( $title)
 

Detailed Description

Search Database.

SearchEngine<extended>

Note
Coverage will only ever show one of on of the Search* classes

Definition at line 12 of file SearchEngineTest.php.

Member Function Documentation

◆ addAugmentors()

SearchEngineTest::addAugmentors ( $setAugmentors,
$rowAugmentors 
)

Definition at line 345 of file SearchEngineTest.php.

References $rowAugmentors, as, class, and SearchResult\getTitle().

◆ addDBDataOnce()

SearchEngineTest::addDBDataOnce ( )

Definition at line 54 of file SearchEngineTest.php.

References NS_CATEGORY, NS_MAIN, and null.

◆ editSearchResultPage()

SearchEngineTest::editSearchResultPage (   $title)
private

◆ fetchIds()

SearchEngineTest::fetchIds (   $results)
protected

◆ hookSearchIndexFields()

SearchEngineTest::hookSearchIndexFields (   $mockFieldBuilder,
$fields,
SearchEngine  $engine 
)

Definition at line 324 of file SearchEngineTest.php.

References SearchIndexField\INDEX_TYPE_TEXT.

◆ provideCompletionSearchMustRespectCapitalLinkOverrides()

SearchEngineTest::provideCompletionSearchMustRespectCapitalLinkOverrides ( )

Definition at line 230 of file SearchEngineTest.php.

References NS_CATEGORY, and NS_MAIN.

◆ provideDataForParseNamespacePrefix()

SearchEngineTest::provideDataForParseNamespacePrefix ( )

Definition at line 403 of file SearchEngineTest.php.

References NS_HELP, and null.

◆ setUp()

SearchEngineTest::setUp ( )
protected

Checks for database type & version.

Will skip current test if DB does not support search.

Definition at line 23 of file SearchEngineTest.php.

References SearchEngineFactory\getSearchEngineClass(), and NS_CATEGORY.

◆ tearDown()

SearchEngineTest::tearDown ( )
protected

Definition at line 48 of file SearchEngineTest.php.

◆ testAugmentorSearch()

SearchEngineTest::testAugmentorSearch ( )

Definition at line 329 of file SearchEngineTest.php.

References as.

◆ testCompletionSearchMustRespectCapitalLinkOverrides()

SearchEngineTest::testCompletionSearchMustRespectCapitalLinkOverrides (   $search,
  $expectedSuggestion,
array  $namespaces 
)

Test that the search query is not munged using wrong CapitalLinks setup (in other test that the default search backend can benefit from wgCapitalLinksOverride) Guard against regressions like T208255 provideCompletionSearchMustRespectCapitalLinkOverrides SearchEngine::completionSearch PrefixSearch::defaultSearchBackend.

Parameters
string$search
string$expectedSuggestion
int[]$namespaces

Definition at line 261 of file SearchEngineTest.php.

◆ testFiltersMissing()

SearchEngineTest::testFiltersMissing ( )

◆ testFullWidth()

SearchEngineTest::testFullWidth ( )

Definition at line 115 of file SearchEngineTest.php.

References fetchIds().

◆ testParseNamespacePrefix()

SearchEngineTest::testParseNamespacePrefix ( array  $params,
  $expected 
)

provideDataForParseNamespacePrefix

Parameters
array$params
array | false$expected
Exceptions
FatalError
MWException

Definition at line 488 of file SearchEngineTest.php.

References $namespaces, $params, $query, as, false, NS_HELP, SearchEngine\parseNamespacePrefixes(), and true.

◆ testPhraseSearch()

SearchEngineTest::testPhraseSearch ( )

Definition at line 167 of file SearchEngineTest.php.

References $res, and fetchIds().

◆ testPhraseSearchHighlight()

SearchEngineTest::testPhraseSearchHighlight ( )

Definition at line 187 of file SearchEngineTest.php.

References $res.

◆ testSearchIndexFields()

SearchEngineTest::testSearchIndexFields ( )

◆ testTextPowerSearch()

SearchEngineTest::testTextPowerSearch ( )

Definition at line 197 of file SearchEngineTest.php.

References fetchIds().

◆ testTextSearch()

SearchEngineTest::testTextSearch ( )

Definition at line 134 of file SearchEngineTest.php.

References fetchIds().

◆ testTextTitlePowerSearch()

SearchEngineTest::testTextTitlePowerSearch ( )

Definition at line 218 of file SearchEngineTest.php.

References fetchIds().

◆ testTitleSearch()

SearchEngineTest::testTitleSearch ( )

Definition at line 208 of file SearchEngineTest.php.

References fetchIds().

◆ testWildcardSearch()

SearchEngineTest::testWildcardSearch ( )

Definition at line 141 of file SearchEngineTest.php.

References $res, and fetchIds().

Member Data Documentation

◆ $search

SearchEngine SearchEngineTest::$search
protected

Definition at line 17 of file SearchEngineTest.php.


The documentation for this class was generated from the following file: