mirror of
https://gerrit.wikimedia.org/r/mediawiki/skins/MinervaNeue
synced 2024-11-24 06:13:54 +00:00
LanguagesHelperTest: Remove unused parameter from method getTitle
The remaining ->expects( $this->any() ) is also removed, because it doesn't check anything. Change-Id: I7651fa7f04fb314ff998cd9d68fd2a6099e4aadb
This commit is contained in:
parent
707d9340a5
commit
0e82eb5d40
|
@ -8,7 +8,6 @@ use MediaWiki\Languages\LanguageConverterFactory;
|
||||||
use MediaWiki\Output\OutputPage;
|
use MediaWiki\Output\OutputPage;
|
||||||
use MediaWiki\Title\Title;
|
use MediaWiki\Title\Title;
|
||||||
use MediaWikiIntegrationTestCase;
|
use MediaWikiIntegrationTestCase;
|
||||||
use PHPUnit\Framework\MockObject\Invocation;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @package Tests\MediaWiki\Minerva
|
* @package Tests\MediaWiki\Minerva
|
||||||
|
@ -34,20 +33,18 @@ class LanguagesHelperTest extends MediaWikiIntegrationTestCase {
|
||||||
/**
|
/**
|
||||||
* Build test Title object
|
* Build test Title object
|
||||||
* @param bool $hasVariants
|
* @param bool $hasVariants
|
||||||
* @param Invocation|null $matcher
|
|
||||||
* @return Title
|
* @return Title
|
||||||
*/
|
*/
|
||||||
private function getTitle( $hasVariants, Invocation $matcher = null ) {
|
private function getTitle( $hasVariants ) {
|
||||||
$languageMock = $this->createMock( Language::class );
|
$languageMock = $this->createMock( Language::class );
|
||||||
$langConv = $this->createMock( ILanguageConverter::class );
|
$langConv = $this->createMock( ILanguageConverter::class );
|
||||||
$langConv->expects( $matcher ?? $this->any() )->method( 'hasVariants' )->willReturn( $hasVariants );
|
$langConv->method( 'hasVariants' )->willReturn( $hasVariants );
|
||||||
$langConvFactory = $this->createMock( LanguageConverterFactory::class );
|
$langConvFactory = $this->createMock( LanguageConverterFactory::class );
|
||||||
$langConvFactory->method( 'getLanguageConverter' )->with( $languageMock )->willReturn( $langConv );
|
$langConvFactory->method( 'getLanguageConverter' )->with( $languageMock )->willReturn( $langConv );
|
||||||
$this->setService( 'LanguageConverterFactory', $langConvFactory );
|
$this->setService( 'LanguageConverterFactory', $langConvFactory );
|
||||||
|
|
||||||
$title = $this->createMock( Title::class );
|
$title = $this->createMock( Title::class );
|
||||||
$title->expects( $matcher ?? $this->any() )
|
$title->method( 'getPageLanguage' )
|
||||||
->method( 'getPageLanguage' )
|
|
||||||
->willReturn( $languageMock );
|
->willReturn( $languageMock );
|
||||||
|
|
||||||
return $title;
|
return $title;
|
||||||
|
|
Loading…
Reference in a new issue