mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/DiscussionTools
synced 2024-11-24 00:13:36 +00:00
Reduce unused mocks in CommentFormatterTest
For example, in case nothing is ever called it's sometimes helpful to use "NoOp" mocks to make this more visible. There is also no actual OutputPage needed, just the much more narrow interface. Change-Id: I44522276726786abd75c85c02a7003c33a5602bb
This commit is contained in:
parent
da90f4b049
commit
15a9304bc5
|
@ -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 );
|
||||
|
|
Loading…
Reference in a new issue