mirror of
https://gerrit.wikimedia.org/r/mediawiki/skins/MinervaNeue
synced 2024-11-23 22:03:39 +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\Title\Title;
|
||||
use MediaWikiIntegrationTestCase;
|
||||
use PHPUnit\Framework\MockObject\Invocation;
|
||||
|
||||
/**
|
||||
* @package Tests\MediaWiki\Minerva
|
||||
|
@ -34,20 +33,18 @@ class LanguagesHelperTest extends MediaWikiIntegrationTestCase {
|
|||
/**
|
||||
* Build test Title object
|
||||
* @param bool $hasVariants
|
||||
* @param Invocation|null $matcher
|
||||
* @return Title
|
||||
*/
|
||||
private function getTitle( $hasVariants, Invocation $matcher = null ) {
|
||||
private function getTitle( $hasVariants ) {
|
||||
$languageMock = $this->createMock( Language::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->method( 'getLanguageConverter' )->with( $languageMock )->willReturn( $langConv );
|
||||
$this->setService( 'LanguageConverterFactory', $langConvFactory );
|
||||
|
||||
$title = $this->createMock( Title::class );
|
||||
$title->expects( $matcher ?? $this->any() )
|
||||
->method( 'getPageLanguage' )
|
||||
$title->method( 'getPageLanguage' )
|
||||
->willReturn( $languageMock );
|
||||
|
||||
return $title;
|
||||
|
|
Loading…
Reference in a new issue