mediawiki-extensions-Echo/tests/phpunit/EchoDbFactoryTest.php
Kunal Mehta c1c91a0c1d Update tests/phpunit for new directory structure
Change-Id: Ic2d5659bb1db89cb62d3703ce59f3e58ba909886
2015-06-15 11:36:02 -07:00

30 lines
773 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 ) );
}
}