From 1bb986c407b6fc86337e5b6ffb42adda2c0a0b21 Mon Sep 17 00:00:00 2001 From: addshore Date: Thu, 1 Feb 2018 15:57:05 +0000 Subject: [PATCH] Use overrideMwServices in DiscussionParserTest Bug: T135023 Change-Id: Ibcef80224c998239f57a9353fa97ba6129fc53b1 --- tests/phpunit/DiscussionParserTest.php | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/tests/phpunit/DiscussionParserTest.php b/tests/phpunit/DiscussionParserTest.php index 51ae799c8..8d0f83a98 100644 --- a/tests/phpunit/DiscussionParserTest.php +++ b/tests/phpunit/DiscussionParserTest.php @@ -1,7 +1,5 @@ true ] ); - - // Since we reset the $wgContLang global, reset the TitleParser service - $services = MediaWikiServices::getInstance(); - if ( is_callable( [ $services, 'getTitleParser' ] ) ) { - // TODO: All of this should use $this->setService() - $services->resetServiceForTesting( 'TitleParser' ); - $services->redefineService( 'TitleParser', function () use ( $langObj ) { - global $wgLocalInterwikis; - return new MediaWikiTitleCodec( - $langObj, - new GenderCache(), - $wgLocalInterwikis - ); - } ); - // Cleanup - $lock = new ScopedCallback( function () use ( $services ) { - $services->resetServiceForTesting( 'TitleParser' ); - } ); - } + $this->overrideMwServices(); // pages to be created: templates may be used to ping users (e.g. // {{u|...}}) but if we don't have that template, it just won't work!