Thiemo Mättig (WMDE) has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/393083 )

Change subject: Remove …->expects( $this->any() ) from all tests
......................................................................

Remove …->expects( $this->any() ) from all tests

This is the default anyway. Not there are really only these 4
instances in this code base, which basically means these are nothing
but rare mistakes.

Change-Id: I1c7abed7b871a2ed728d0a0bfc7aa871c2823392
---
M tests/phpunit/mediawiki/Content/LexemeHandlerTest.php
M tests/phpunit/mediawiki/Diff/LexemeDiffVisualizerTest.php
M tests/phpunit/mediawiki/Validators/LexemeValidatorFactoryTest.php
M tests/phpunit/mediawiki/Validators/LexemeValidatorFactoryTestMockProvider.php
4 files changed, 4 insertions(+), 8 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikibaseLexeme 
refs/changes/83/393083/1

diff --git a/tests/phpunit/mediawiki/Content/LexemeHandlerTest.php 
b/tests/phpunit/mediawiki/Content/LexemeHandlerTest.php
index cc72d91..822ff12 100644
--- a/tests/phpunit/mediawiki/Content/LexemeHandlerTest.php
+++ b/tests/phpunit/mediawiki/Content/LexemeHandlerTest.php
@@ -139,8 +139,7 @@
                $labelLookupFactory = $this->getMockWithoutConstructor(
                        LanguageFallbackLabelDescriptionLookupFactory::class
                );
-               $labelLookupFactory->expects( $this->any() )
-                       ->method( 'newLabelDescriptionLookup' )
+               $labelLookupFactory->method( 'newLabelDescriptionLookup' )
                        ->will( $this->returnValue( $this->getMock( 
LabelDescriptionLookup::class ) ) );
 
                return new LexemeHandler(
diff --git a/tests/phpunit/mediawiki/Diff/LexemeDiffVisualizerTest.php 
b/tests/phpunit/mediawiki/Diff/LexemeDiffVisualizerTest.php
index 6d4200b..5a83d67 100644
--- a/tests/phpunit/mediawiki/Diff/LexemeDiffVisualizerTest.php
+++ b/tests/phpunit/mediawiki/Diff/LexemeDiffVisualizerTest.php
@@ -90,8 +90,7 @@
        private function getMockMessageLocalizer() {
                $mock = $this->getMock( MessageLocalizer::class );
 
-               $mock->expects( $this->any() )
-                       ->method( 'msg' )
+               $mock->method( 'msg' )
                        ->will( $this->returnCallback( function ( $key ) {
                                return new RawMessage( "($key)" );
                        } ) );
diff --git a/tests/phpunit/mediawiki/Validators/LexemeValidatorFactoryTest.php 
b/tests/phpunit/mediawiki/Validators/LexemeValidatorFactoryTest.php
index 20800fe..45c4c69 100644
--- a/tests/phpunit/mediawiki/Validators/LexemeValidatorFactoryTest.php
+++ b/tests/phpunit/mediawiki/Validators/LexemeValidatorFactoryTest.php
@@ -247,8 +247,7 @@
                $validatorMock = $this->getMockBuilder( 
EntityExistsValidator::class )
                        ->disableOriginalConstructor()
                        ->getMock();
-               $validatorMock->expects( $this->any() )
-                       ->method( 'validate' )
+               $validatorMock->method( 'validate' )
                        ->will( $this->returnCallback( function ( $itemId ) use 
( $existingItemIds ) {
                                return $this->validateItemId( $itemId, 
$existingItemIds );
                        } ) );
diff --git 
a/tests/phpunit/mediawiki/Validators/LexemeValidatorFactoryTestMockProvider.php 
b/tests/phpunit/mediawiki/Validators/LexemeValidatorFactoryTestMockProvider.php
index 614f475..f27303b 100644
--- 
a/tests/phpunit/mediawiki/Validators/LexemeValidatorFactoryTestMockProvider.php
+++ 
b/tests/phpunit/mediawiki/Validators/LexemeValidatorFactoryTestMockProvider.php
@@ -80,8 +80,7 @@
                $validatorMock = $testCase->getMockBuilder( 
EntityExistsValidator::class )
                        ->disableOriginalConstructor()
                        ->getMock();
-               $validatorMock->expects( $testCase->any() )
-                       ->method( 'validate' )
+               $validatorMock->method( 'validate' )
                        ->will( $testCase->returnCallback( function ( $itemId ) 
use ( $existingItemIds ) {
                                return $this->validateItemId( $itemId, 
$existingItemIds );
                        } ) );

-- 
To view, visit https://gerrit.wikimedia.org/r/393083
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1c7abed7b871a2ed728d0a0bfc7aa871c2823392
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikibaseLexeme
Gerrit-Branch: master
Gerrit-Owner: Thiemo Mättig (WMDE) <thiemo.kr...@wikimedia.de>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to