mediawiki-extensions-Echo/tests/phpunit/EchoDbFactoryTest.php
Siebrand Mazeland 33126b69aa Update formatting
In preparation of Code Sniffer based updates.

Change-Id: Id5d43332b44a37665d57dc24ef8c432bc65b2f6a
2015-10-03 23:28:54 -04:00

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 ) );
}
}