mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-11-25 00:05:29 +00:00
33126b69aa
In preparation of Code Sniffer based updates. Change-Id: Id5d43332b44a37665d57dc24ef8c432bc65b2f6a
31 lines
774 B
PHP
31 lines
774 B
PHP
<?php
|
|
|
|
class MWEchoDbFactoryTest extends MediaWikiTestCase {
|
|
|
|
public function testNewFromDefault() {
|
|
$db = MWEchoDbFactory::newFromDefault();
|
|
$this->assertInstanceOf( 'MWEchoDbFactory', $db );
|
|
|
|
return $db;
|
|
}
|
|
|
|
/**
|
|
* @depends testNewFromDefault
|
|
*/
|
|
public function testGetEchoDb( MWEchoDbFactory $db ) {
|
|
$this->assertInstanceOf( 'DatabaseBase', $db->getEchoDb( DB_MASTER ) );
|
|
$this->assertInstanceOf( 'DatabaseBase', $db->getEchoDb( DB_SLAVE ) );
|
|
}
|
|
|
|
/**
|
|
* @depends testNewFromDefault
|
|
*/
|
|
public function testGetLB( MWEchoDbFactory $db ) {
|
|
$reflection = new ReflectionClass( 'MWEchoDbFactory' );
|
|
$method = $reflection->getMethod( 'getLB' );
|
|
$method->setAccessible( true );
|
|
$this->assertInstanceOf( 'LoadBalancer', $method->invoke( $db ) );
|
|
}
|
|
|
|
}
|