From 0e82eb5d401a99c632a393b567fffe5384c26d65 Mon Sep 17 00:00:00 2001 From: Fomafix Date: Sat, 2 Mar 2024 20:07:16 +0000 Subject: [PATCH] LanguagesHelperTest: Remove unused parameter from method getTitle The remaining ->expects( $this->any() ) is also removed, because it doesn't check anything. Change-Id: I7651fa7f04fb314ff998cd9d68fd2a6099e4aadb --- tests/phpunit/LanguagesHelperTest.php | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/tests/phpunit/LanguagesHelperTest.php b/tests/phpunit/LanguagesHelperTest.php index 0abddbdfc..39d3a1c63 100644 --- a/tests/phpunit/LanguagesHelperTest.php +++ b/tests/phpunit/LanguagesHelperTest.php @@ -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;