X-Git-Url: https://git.cyclocoop.org/%28%28?a=blobdiff_plain;ds=sidebyside;f=tests%2Fphpunit%2Fincludes%2Fsearch%2FSearchEnginePrefixTest.php;h=e0de58866f377fe9245d1f0e3fe3e9b6f82ee1f9;hb=b257385ff2267075d8b389e9103eeabdf09a6578;hp=6a3f95bb221d45007b339b82457d257a6e599477;hpb=0d0059d36e7494792378c020f5de6033985c3637;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/phpunit/includes/search/SearchEnginePrefixTest.php b/tests/phpunit/includes/search/SearchEnginePrefixTest.php index 6a3f95bb22..e0de58866f 100644 --- a/tests/phpunit/includes/search/SearchEnginePrefixTest.php +++ b/tests/phpunit/includes/search/SearchEnginePrefixTest.php @@ -1,9 +1,12 @@ setMwGlobals( 'wgSpecialPages', [] ); - $this->search = SearchEngine::create(); + $this->setMwGlobals( [ + 'wgSpecialPages' => [], + 'wgHooks' => [], + ] ); + + $this->search = MediaWikiServices::getInstance()->newSearchEngine(); $this->search->setNamespaces( [] ); + + $this->originalHandlers = TestingAccessWrapper::newFromClass( 'Hooks' )->handlers; + TestingAccessWrapper::newFromClass( 'Hooks' )->handlers = []; + + SpecialPageFactory::resetList(); + } + + public function tearDown() { + parent::tearDown(); + + TestingAccessWrapper::newFromClass( 'Hooks' )->handlers = $this->originalHandlers; + + SpecialPageFactory::resetList(); } protected function searchProvision( array $results = null ) {