rdbms: Use more narrow type hints in LBFactoryTest

Originally I wanted to fix the broken type hint for the `Database`
class. But I ended limiting the scope as much as possible and only
type hint at the interfaces that contain the methods the code actually
needs.

Change-Id: I450a55e80612f6e676f7c803dc904b4b653426d8
This commit is contained in:
Thiemo Kreuz 2019-02-12 13:01:26 +01:00 committed by Krinkle
parent f51c9e889f
commit eee735a176

View file

@ -23,6 +23,9 @@
* @copyright © 2013 Wikimedia Foundation Inc.
*/
use Wikimedia\Rdbms\Database;
use Wikimedia\Rdbms\IDatabase;
use Wikimedia\Rdbms\IMaintainableDatabase;
use Wikimedia\Rdbms\LBFactory;
use Wikimedia\Rdbms\LBFactorySimple;
use Wikimedia\Rdbms\LBFactoryMulti;
@ -456,7 +459,7 @@ class LBFactoryTest extends MediaWikiTestCase {
);
unset( $db );
/** @var Database $db */
/** @var IMaintainableDatabase $db */
$db = $lb->getConnection( DB_MASTER, [], '' );
$this->assertEquals(
@ -531,7 +534,7 @@ class LBFactoryTest extends MediaWikiTestCase {
]
);
$lb = $factory->getMainLB();
/** @var Database $db */
/** @var IMaintainableDatabase $db */
$db = $lb->getConnection( DB_MASTER, [], '' );
$this->assertEquals( '', $db->getDomainID(), "Null domain used" );
@ -592,7 +595,7 @@ class LBFactoryTest extends MediaWikiTestCase {
]
);
$lb = $factory->getMainLB();
/** @var Database $db */
/** @var IDatabase $db */
$db = $lb->getConnection( DB_MASTER, [], '' );
if ( $db->getType() === 'sqlite' ) {