mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-12-01 10:56:44 +00:00
d3d99772b9
* Get rid of EchoBackend by separating responsibilities into smaller objects * Move main fetchNotification logic from API to a more appropriate place * Add more unit testing coverage Change-Id: I42f4d7566543332588431c21c220c0d64d026b70
30 lines
773 B
PHP
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 ) );
|
|
}
|
|
|
|
}
|