aboutsummaryrefslogtreecommitdiffstats
path: root/tests/phpunit/includes/Storage/NameTableStoreTest.php
diff options
context:
space:
mode:
authorThiemo Kreuz <thiemo.kreuz@wikimedia.de>2021-04-22 10:40:46 +0200
committerThiemo Kreuz <thiemo.kreuz@wikimedia.de>2021-04-23 11:58:58 +0200
commitb95a07380a64e72581a8bf41f466f58a1901ecb1 (patch)
treec4c271c16b01c10685f4bef807b71d1e2a41bf2d /tests/phpunit/includes/Storage/NameTableStoreTest.php
parent791aa5e30666ab10736266e1d04c506aec771d96 (diff)
downloadmediawikicore-b95a07380a64e72581a8bf41f466f58a1901ecb1.tar.gz
mediawikicore-b95a07380a64e72581a8bf41f466f58a1901ecb1.zip
Remove meaningless ->expects( $this->any() ) from all tests
It is not entirely meaningless. It might be an indicator that the number of calls to a method is intentionally unlimited. This is similar to e.g. an @inheritDoc PHPDoc comment that marks a method as being "intentionally undocumented". However, what's the meaning of being "intentionally unconstrained"? Let's just not have any constraint then. I feel all these ->expects( $this->any() ) bloat the test code so much that it's never worth it. Change-Id: I9925e7706bd03e1666f6eb0b284cb42b0dd3be23
Diffstat (limited to 'tests/phpunit/includes/Storage/NameTableStoreTest.php')
-rw-r--r--tests/phpunit/includes/Storage/NameTableStoreTest.php3
1 files changed, 1 insertions, 2 deletions
diff --git a/tests/phpunit/includes/Storage/NameTableStoreTest.php b/tests/phpunit/includes/Storage/NameTableStoreTest.php
index bb9304cb0342..2eaa77abc206 100644
--- a/tests/phpunit/includes/Storage/NameTableStoreTest.php
+++ b/tests/phpunit/includes/Storage/NameTableStoreTest.php
@@ -54,8 +54,7 @@ class NameTableStoreTest extends MediaWikiIntegrationTestCase {
$mock = $this->getMockBuilder( LoadBalancer::class )
->disableOriginalConstructor()
->getMock();
- $mock->expects( $this->any() )
- ->method( 'getConnectionRef' )
+ $mock->method( 'getConnectionRef' )
->willReturnCallback( static function ( $i ) use ( $mock, $db ) {
return new MaintainableDBConnRef( $mock, $db, $i );
} );