Avoid deprecated IDatabase::getWikiId() reference
authorAaron Schulz <aschulz@wikimedia.org>
Fri, 6 Jul 2018 19:19:51 +0000 (20:19 +0100)
committerKrinkle <krinklemail@gmail.com>
Sat, 7 Jul 2018 22:55:15 +0000 (22:55 +0000)
Change-Id: I26991079b1630335c8a6e907554760fc85c1bad6

includes/libs/rdbms/database/DBConnRef.php
tests/phpunit/includes/libs/rdbms/database/DBConnRefTest.php

index b414a2a..50fdc27 100644 (file)
@@ -167,6 +167,9 @@ class DBConnRef implements IDatabase {
                return $this->__call( __FUNCTION__, func_get_args() );
        }
 
+       /**
+        * @codeCoverageIgnore
+        */
        public function getWikiID() {
                return $this->getDomainID();
        }
index c3cddc6..e130b23 100644 (file)
@@ -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 );