Merge "Reduce unused mocks in CommentFormatterTest"

This commit is contained in:
jenkins-bot 2024-06-24 16:07:28 +00:00 committed by Gerrit Code Review
commit 5b415eb241

View file

@ -4,7 +4,7 @@ namespace MediaWiki\Extension\DiscussionTools\Tests;
use FormatJson;
use MediaWiki\Cache\GenderCache;
use MediaWiki\Config\Config;
use MediaWiki\Context\IContextSource;
use MediaWiki\MainConfigNames;
use MediaWiki\MediaWikiServices;
use MediaWiki\Output\OutputPage;
@ -55,7 +55,7 @@ class CommentFormatterTest extends IntegrationTestCase {
string $name, string $titleText, string $dom, string $expected, string $config, string $data,
bool $isMobile, bool $useButtons
): void {
$this->setService( 'GenderCache', $this->createMock( GenderCache::class ) );
$this->setService( 'GenderCache', $this->createNoOpMock( GenderCache::class ) );
$dom = static::getHtml( $dom );
$expectedPath = $expected;
$expected = static::getText( $expectedPath );
@ -77,8 +77,7 @@ class CommentFormatterTest extends IntegrationTestCase {
$qqxLang = MediaWikiServices::getInstance()->getLanguageFactory()->getLanguage( 'qqx' );
$skin = $this->createMock( Skin::class );
$skin->method( 'getSkinName' )->willReturn( 'minerva' );
$outputPage = $this->createMock( OutputPage::class );
$outputPage->method( 'getConfig' )->willReturn( $this->createMock( Config::class ) );
$outputPage = $this->createMock( IContextSource::class );
$outputPage->method( 'getTitle' )->willReturn( $title );
$outputPage->method( 'getUser' )->willReturn( $user );
$outputPage->method( 'getLanguage' )->willReturn( $qqxLang );