diff options
author | Thiemo Kreuz <thiemo.kreuz@wikimedia.de> | 2021-04-22 09:56:11 +0200 |
---|---|---|
committer | Thiemo Kreuz <thiemo.kreuz@wikimedia.de> | 2021-04-23 12:02:42 +0200 |
commit | c1ee8250e9bc9c9c3161ca0ded3946fd2af1da7d (patch) | |
tree | ed0c960ea070ecc91b10bf708b70977f84080420 /tests/phpunit/unit/includes/editpage/Constraint/SpamRegexConstraintTest.php | |
parent | 74653506a88de1bdadbc927b201f9ac6967fab5f (diff) | |
download | mediawikicore-c1ee8250e9bc9c9c3161ca0ded3946fd2af1da7d.tar.gz mediawikicore-c1ee8250e9bc9c9c3161ca0ded3946fd2af1da7d.zip |
Remove unnecessary ->equalTo() from tests
This is the default anyway when using ->with(). The test code
becomes so much more readable without this, I would like to
argue. Let it just say "with these values".
Because of the way I split my changes into multiple patches
there are a few other changes in this patch I could not split,
e.g. removing unnecessary ->any(). This is the default anyway
and doesn't make the test more specific.
Change-Id: I34990799fa9258ba8dc64c7e78ec43f7903b7681
Diffstat (limited to 'tests/phpunit/unit/includes/editpage/Constraint/SpamRegexConstraintTest.php')
-rw-r--r-- | tests/phpunit/unit/includes/editpage/Constraint/SpamRegexConstraintTest.php | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/phpunit/unit/includes/editpage/Constraint/SpamRegexConstraintTest.php b/tests/phpunit/unit/includes/editpage/Constraint/SpamRegexConstraintTest.php index 8fabbb94703c..ce39e9869490 100644 --- a/tests/phpunit/unit/includes/editpage/Constraint/SpamRegexConstraintTest.php +++ b/tests/phpunit/unit/includes/editpage/Constraint/SpamRegexConstraintTest.php @@ -42,13 +42,13 @@ class SpamRegexConstraintTest extends MediaWikiUnitTestCase { $spamChecker = $this->createMock( SpamChecker::class ); $spamChecker->expects( $this->once() ) ->method( 'checkSummary' ) - ->with( $this->equalTo( $summary ) ) + ->with( $summary ) ->willReturn( false ); $spamChecker->expects( $this->exactly( 2 ) ) ->method( 'checkContent' ) ->withConsecutive( - [ $this->equalTo( $sectionHeading ) ], - [ $this->equalTo( $text ) ] + [ $sectionHeading ], + [ $text ] ) ->willReturn( false ); @@ -80,7 +80,7 @@ class SpamRegexConstraintTest extends MediaWikiUnitTestCase { $spamChecker = $this->createMock( SpamChecker::class ); $spamChecker->expects( $this->once() ) ->method( 'checkSummary' ) - ->with( $this->equalTo( $summary ) ) + ->with( $summary ) ->willReturn( $matchingText ); $prefixedDBKey = 'PrefixedDBKeyGoesHere'; |