From 5b50d1647bacec1331b379365d6bee6905f017bf Mon Sep 17 00:00:00 2001 From: Jakob Warkotsch Date: Fri, 17 Jan 2025 15:32:03 +0100 Subject: [PATCH] Remove TermsDomainDb::getReadConnection param This was never needed for the terms db access. Bug: T351802 Change-Id: Iaad4de4029943d03414a3b9373f0a1cc062b9d08 --- lib/includes/Rdbms/RepoDomainTermsDb.php | 4 ++-- lib/includes/Rdbms/TermsDomainDb.php | 2 +- lib/tests/phpunit/Rdbms/RepoDomainTermsDbTest.php | 4 +--- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/lib/includes/Rdbms/RepoDomainTermsDb.php b/lib/includes/Rdbms/RepoDomainTermsDb.php index 35f355a17f..063390fe01 100644 --- a/lib/includes/Rdbms/RepoDomainTermsDb.php +++ b/lib/includes/Rdbms/RepoDomainTermsDb.php @@ -28,8 +28,8 @@ public function getAutoCommitPrimaryConnection(): IDatabase { return $this->repoDb->getAutoCommitPrimaryConnection(); } - public function getReadConnection( ?array $groups = null ): IReadableDatabase { - return $this->repoDb->connections()->getReadConnection( $groups ); + public function getReadConnection(): IReadableDatabase { + return $this->repoDb->connections()->getReadConnection(); } public function waitForReplicationOfAllAffectedClusters( ?int $timeout = null ): void { diff --git a/lib/includes/Rdbms/TermsDomainDb.php b/lib/includes/Rdbms/TermsDomainDb.php index 934a1c47dc..f7ddb57bd5 100644 --- a/lib/includes/Rdbms/TermsDomainDb.php +++ b/lib/includes/Rdbms/TermsDomainDb.php @@ -21,7 +21,7 @@ public function getWriteConnection(): IDatabase; public function getAutoCommitPrimaryConnection(): IDatabase; - public function getReadConnection( ?array $groups = null ): IReadableDatabase; + public function getReadConnection(): IReadableDatabase; public function waitForReplicationOfAllAffectedClusters( ?int $timeout = null ): void; diff --git a/lib/tests/phpunit/Rdbms/RepoDomainTermsDbTest.php b/lib/tests/phpunit/Rdbms/RepoDomainTermsDbTest.php index 7fa8209771..718dfbe51a 100644 --- a/lib/tests/phpunit/Rdbms/RepoDomainTermsDbTest.php +++ b/lib/tests/phpunit/Rdbms/RepoDomainTermsDbTest.php @@ -20,13 +20,11 @@ class RepoDomainTermsDbTest extends \PHPUnit\Framework\TestCase { public function testGetReadConnection(): void { - $loadGroups = [ 'some group' ]; $expected = $this->createStub( IDatabase::class ); $connectionManager = $this->createMock( ConnectionManager::class ); $connectionManager->expects( $this->once() ) ->method( 'getReadConnection' ) - ->with( $loadGroups ) ->willReturn( $expected ); $repoDomainDb = $this->createStub( RepoDomainDb::class ); @@ -34,7 +32,7 @@ public function testGetReadConnection(): void { $this->assertSame( $expected, - ( new RepoDomainTermsDb( $repoDomainDb ) )->getReadConnection( $loadGroups ) + ( new RepoDomainTermsDb( $repoDomainDb ) )->getReadConnection() ); }