From: Aaron Schulz Date: Fri, 6 Jul 2018 19:19:51 +0000 (+0100) Subject: Avoid deprecated IDatabase::getWikiId() reference X-Git-Tag: 1.34.0-rc.0~4850^2 X-Git-Url: http://git.cyclocoop.org/%7D%7Cconcat%7B?a=commitdiff_plain;h=86dd3b0ac03c1fda97cf4a0055f8f05710659c68;p=lhc%2Fweb%2Fwiklou.git Avoid deprecated IDatabase::getWikiId() reference Change-Id: I26991079b1630335c8a6e907554760fc85c1bad6 --- diff --git a/includes/libs/rdbms/database/DBConnRef.php b/includes/libs/rdbms/database/DBConnRef.php index b414a2a02a..50fdc27121 100644 --- a/includes/libs/rdbms/database/DBConnRef.php +++ b/includes/libs/rdbms/database/DBConnRef.php @@ -167,6 +167,9 @@ class DBConnRef implements IDatabase { return $this->__call( __FUNCTION__, func_get_args() ); } + /** + * @codeCoverageIgnore + */ public function getWikiID() { return $this->getDomainID(); } diff --git a/tests/phpunit/includes/libs/rdbms/database/DBConnRefTest.php b/tests/phpunit/includes/libs/rdbms/database/DBConnRefTest.php index c3cddc61dc..e130b23cff 100644 --- a/tests/phpunit/includes/libs/rdbms/database/DBConnRefTest.php +++ b/tests/phpunit/includes/libs/rdbms/database/DBConnRefTest.php @@ -12,6 +12,7 @@ use Wikimedia\Rdbms\ResultWrapper; */ class DBConnRefTest extends PHPUnit\Framework\TestCase { + use MediaWikiCoversValidator; use PHPUnit4And6Compat; /** @@ -106,18 +107,9 @@ class DBConnRefTest extends PHPUnit\Framework\TestCase { new DBConnRef( $lb, 17 ); // bad constructor argument } - public function testGetWikiID() { - $lb = $this->getMock( ILoadBalancer::class ); - - // getWikiID is optimized to not create a connection - $lb->expects( $this->never() ) - ->method( 'getConnection' ); - - $ref = new DBConnRef( $lb, [ DB_REPLICA, [], 'dummy', 0 ] ); - - $this->assertSame( 'dummy', $ref->getWikiID() ); - } - + /** + * @covers Wikimedia\Rdbms\DBConnRef::getDomainId + */ public function testGetDomainID() { $lb = $this->getMock( ILoadBalancer::class );