mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-11-12 09:26:05 +00:00
Merge "Check for IDatabase (not DatabaseBase) in tests"
This commit is contained in:
commit
4d3f4ae98f
|
@ -1,5 +1,8 @@
|
|||
<?php
|
||||
|
||||
use Wikimedia\Rdbms\IDatabase;
|
||||
use Wikimedia\Rdbms\ILoadBalancer;
|
||||
|
||||
class MWEchoDbFactoryTest extends MediaWikiTestCase {
|
||||
|
||||
public function testNewFromDefault() {
|
||||
|
@ -13,8 +16,8 @@ class MWEchoDbFactoryTest extends MediaWikiTestCase {
|
|||
* @depends testNewFromDefault
|
||||
*/
|
||||
public function testGetEchoDb( MWEchoDbFactory $db ) {
|
||||
$this->assertInstanceOf( 'DatabaseBase', $db->getEchoDb( DB_MASTER ) );
|
||||
$this->assertInstanceOf( 'DatabaseBase', $db->getEchoDb( DB_REPLICA ) );
|
||||
$this->assertInstanceOf( IDatabase::class, $db->getEchoDb( DB_MASTER ) );
|
||||
$this->assertInstanceOf( IDatabase::class, $db->getEchoDb( DB_REPLICA ) );
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -24,7 +27,7 @@ class MWEchoDbFactoryTest extends MediaWikiTestCase {
|
|||
$reflection = new ReflectionClass( 'MWEchoDbFactory' );
|
||||
$method = $reflection->getMethod( 'getLB' );
|
||||
$method->setAccessible( true );
|
||||
$this->assertInstanceOf( 'LoadBalancer', $method->invoke( $db ) );
|
||||
$this->assertInstanceOf( ILoadBalancer::class, $method->invoke( $db ) );
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue