Skip to content

Commit

Permalink
Remove TermsDomainDb::getReadConnection param
Browse files Browse the repository at this point in the history
This was never needed for the terms db access.

Bug: T351802
Change-Id: Iaad4de4029943d03414a3b9373f0a1cc062b9d08
  • Loading branch information
jakobw committed Jan 20, 2025
1 parent 0947814 commit 5b50d16
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
4 changes: 2 additions & 2 deletions lib/includes/Rdbms/RepoDomainTermsDb.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion lib/includes/Rdbms/TermsDomainDb.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
4 changes: 1 addition & 3 deletions lib/tests/phpunit/Rdbms/RepoDomainTermsDbTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,19 @@
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 );
$repoDomainDb->method( 'connections' )->willReturn( $connectionManager );

$this->assertSame(
$expected,
( new RepoDomainTermsDb( $repoDomainDb ) )->getReadConnection( $loadGroups )
( new RepoDomainTermsDb( $repoDomainDb ) )->getReadConnection()
);
}

Expand Down

0 comments on commit 5b50d16

Please sign in to comment.