Fix SearchEngineTest when $wgSearchType is set to non-default
authoraude <aude.wiki@gmail.com>
Fri, 3 Jan 2014 01:23:16 +0000 (02:23 +0100)
committeraude <aude.wiki@gmail.com>
Fri, 3 Jan 2014 10:28:41 +0000 (11:28 +0100)
commit73bc21bb1cb1fc9e242686f2abbb7a302bf36823
tree404e6e30fe0522f8fb8b573bdcb445ca1abfd441
parent69246bb7661bb45e23c66c265435388fb7880ade
Fix SearchEngineTest when $wgSearchType is set to non-default

$wgSearchType needs to be controlled for at time the pages get created.
This patch sets the $wgSearchType global.

Also, the 'singleton' is removed from SearchEngine::getSearchTypes, which
appears to provide little or no benefit while binding all tests to the
global variable.

SearchEngine::getSearchTypes() gets called in SearchUpdate which is
run on page edits. This means the first page edit in the entire
test suite causes the global variable to be set and subsequent tests
cannot override it.

These changes allow SearchEngineTest to pass, even if one has CirrusSearch
or other such extensions enabled.

Change-Id: I39050da8659dc69db31125f469f494a5fb4b8fca
includes/search/SearchEngine.php
tests/phpunit/includes/search/SearchEngineTest.php