Instead of passing the LoadBalancer and than get the LBFactory from the
service,
store the LBFactory on creation
Bug: T206601
Change-Id: I4c0d3712da591b2c5ddf2a65855d2cc9142417d2
'WatchedItemStore' => function ( MediaWikiServices $services ) : WatchedItemStore {
$store = new WatchedItemStore(
'WatchedItemStore' => function ( MediaWikiServices $services ) : WatchedItemStore {
$store = new WatchedItemStore(
- $services->getDBLoadBalancer(),
+ $services->getDBLoadBalancerFactory(),
new HashBagOStuff( [ 'maxKeys' => 100 ] ),
$services->getReadOnlyMode(),
$services->getMainConfig()->get( 'UpdateRowsPerQuery' )
new HashBagOStuff( [ 'maxKeys' => 100 ] ),
$services->getReadOnlyMode(),
$services->getMainConfig()->get( 'UpdateRowsPerQuery' )
use Wikimedia\Rdbms\IDatabase;
use Liuggio\StatsdClient\Factory\StatsdDataFactoryInterface;
use MediaWiki\Linker\LinkTarget;
use Wikimedia\Rdbms\IDatabase;
use Liuggio\StatsdClient\Factory\StatsdDataFactoryInterface;
use MediaWiki\Linker\LinkTarget;
-use MediaWiki\MediaWikiServices;
use Wikimedia\Assert\Assert;
use Wikimedia\ScopedCallback;
use Wikimedia\Assert\Assert;
use Wikimedia\ScopedCallback;
+use Wikimedia\Rdbms\ILBFactory;
use Wikimedia\Rdbms\LoadBalancer;
/**
use Wikimedia\Rdbms\LoadBalancer;
/**
*/
class WatchedItemStore implements WatchedItemStoreInterface, StatsdAwareInterface {
*/
class WatchedItemStore implements WatchedItemStoreInterface, StatsdAwareInterface {
+ /**
+ * @var ILBFactory
+ */
+ private $lbFactory;
+
/**
* @var LoadBalancer
*/
/**
* @var LoadBalancer
*/
- * @param LoadBalancer $loadBalancer
+ * @param ILBFactory $lbFactory
* @param HashBagOStuff $cache
* @param ReadOnlyMode $readOnlyMode
* @param int $updateRowsPerQuery
*/
public function __construct(
* @param HashBagOStuff $cache
* @param ReadOnlyMode $readOnlyMode
* @param int $updateRowsPerQuery
*/
public function __construct(
- LoadBalancer $loadBalancer,
HashBagOStuff $cache,
ReadOnlyMode $readOnlyMode,
$updateRowsPerQuery
) {
HashBagOStuff $cache,
ReadOnlyMode $readOnlyMode,
$updateRowsPerQuery
) {
- $this->loadBalancer = $loadBalancer;
+ $this->lbFactory = $lbFactory;
+ $this->loadBalancer = $lbFactory->getMainLB();
$this->cache = $cache;
$this->readOnlyMode = $readOnlyMode;
$this->stats = new NullStatsdDataFactory();
$this->cache = $cache;
$this->readOnlyMode = $readOnlyMode;
$this->stats = new NullStatsdDataFactory();
global $wgUpdateRowsPerQuery;
$dbw = $this->getConnectionRef( DB_MASTER );
global $wgUpdateRowsPerQuery;
$dbw = $this->getConnectionRef( DB_MASTER );
- $factory = MediaWikiServices::getInstance()->getDBLoadBalancerFactory();
- $ticket = $factory->getEmptyTransactionTicket( $fname );
+ $ticket = $this->lbFactory->getEmptyTransactionTicket( $fname );
$watchersChunks = array_chunk( $watchers, $wgUpdateRowsPerQuery );
foreach ( $watchersChunks as $watchersChunk ) {
$watchersChunks = array_chunk( $watchers, $wgUpdateRowsPerQuery );
foreach ( $watchersChunks as $watchersChunk ) {
], $fname
);
if ( count( $watchersChunks ) > 1 ) {
], $fname
);
if ( count( $watchersChunks ) > 1 ) {
- $factory->commitAndWaitForReplication(
+ $this->lbFactory->commitAndWaitForReplication(
$fname, $ticket, [ 'domain' => $dbw->getDomainID() ]
);
}
$fname, $ticket, [ 'domain' => $dbw->getDomainID() ]
);
}
<?php
use MediaWiki\Linker\LinkTarget;
use Wikimedia\Rdbms\LoadBalancer;
<?php
use MediaWiki\Linker\LinkTarget;
use Wikimedia\Rdbms\LoadBalancer;
+use Wikimedia\Rdbms\LBFactory;
use Wikimedia\ScopedCallback;
use Wikimedia\TestingAccessWrapper;
use Wikimedia\ScopedCallback;
use Wikimedia\TestingAccessWrapper;
+ /**
+ * @return PHPUnit_Framework_MockObject_MockObject|LBFactory
+ */
+ private function getMockLBFactory(
+ $mockDb,
+ $expectedConnectionType = null
+ ) {
+ $loadBalancer = $this->getMockLoadBalancer( $mockDb, $expectedConnectionType );
+ $mock = $this->getMockBuilder( LBFactory::class )
+ ->disableOriginalConstructor()
+ ->getMock();
+ $mock->expects( $this->any() )
+ ->method( 'getMainLB' )
+ ->will( $this->returnValue( $loadBalancer ) );
+ return $mock;
+ }
+
/**
* @return PHPUnit_Framework_MockObject_MockObject|HashBagOStuff
*/
/**
* @return PHPUnit_Framework_MockObject_MockObject|HashBagOStuff
*/
- private function newWatchedItemStore( LoadBalancer $loadBalancer, HashBagOStuff $cache,
+ private function newWatchedItemStore( LBFactory $lbFactory, HashBagOStuff $cache,
ReadOnlyMode $readOnlyMode
) {
return new WatchedItemStore(
ReadOnlyMode $readOnlyMode
) {
return new WatchedItemStore(
$cache,
$readOnlyMode,
1000
$cache,
$readOnlyMode,
1000
->with( 'RM-KEY' );
$store = $this->newWatchedItemStore(
->with( 'RM-KEY' );
$store = $this->newWatchedItemStore(
- $this->getMockLoadBalancer( $mockDb ),
+ $this->getMockLBFactory( $mockDb ),
$mockCache,
$this->getMockReadOnlyMode()
);
$mockCache,
$this->getMockReadOnlyMode()
);
$mockCache->expects( $this->never() )->method( 'delete' );
$store = $this->newWatchedItemStore(
$mockCache->expects( $this->never() )->method( 'delete' );
$store = $this->newWatchedItemStore(
- $this->getMockLoadBalancer( $mockDb ),
+ $this->getMockLBFactory( $mockDb ),
$mockCache,
$this->getMockReadOnlyMode()
);
$mockCache,
$this->getMockReadOnlyMode()
);
$mockCache->expects( $this->never() )->method( 'delete' );
$store = $this->newWatchedItemStore(
$mockCache->expects( $this->never() )->method( 'delete' );
$store = $this->newWatchedItemStore(
- $this->getMockLoadBalancer( $mockDb ),
+ $this->getMockLBFactory( $mockDb ),
$mockCache,
$this->getMockReadOnlyMode()
);
$mockCache,
$this->getMockReadOnlyMode()
);
$mockCache->expects( $this->never() )->method( 'delete' );
$store = $this->newWatchedItemStore(
$mockCache->expects( $this->never() )->method( 'delete' );
$store = $this->newWatchedItemStore(
- $this->getMockLoadBalancer( $mockDb ),
+ $this->getMockLBFactory( $mockDb ),
$mockCache,
$this->getMockReadOnlyMode()
);
$mockCache,
$this->getMockReadOnlyMode()
);
$mockCache->expects( $this->never() )->method( 'delete' );
$store = $this->newWatchedItemStore(
$mockCache->expects( $this->never() )->method( 'delete' );
$store = $this->newWatchedItemStore(
- $this->getMockLoadBalancer( $mockDb ),
+ $this->getMockLBFactory( $mockDb ),
$mockCache,
$this->getMockReadOnlyMode()
);
$mockCache,
$this->getMockReadOnlyMode()
);
$mockCache->expects( $this->never() )->method( 'delete' );
$store = $this->newWatchedItemStore(
$mockCache->expects( $this->never() )->method( 'delete' );
$store = $this->newWatchedItemStore(
- $this->getMockLoadBalancer( $mockDb ),
+ $this->getMockLBFactory( $mockDb ),
$mockCache,
$this->getMockReadOnlyMode()
);
$mockCache,
$this->getMockReadOnlyMode()
);
$mockCache->expects( $this->never() )->method( 'delete' );
$store = $this->newWatchedItemStore(
$mockCache->expects( $this->never() )->method( 'delete' );
$store = $this->newWatchedItemStore(
- $this->getMockLoadBalancer( $mockDb ),
+ $this->getMockLBFactory( $mockDb ),
$mockCache,
$this->getMockReadOnlyMode()
);
$mockCache,
$this->getMockReadOnlyMode()
);
$mockCache->expects( $this->never() )->method( 'delete' );
$store = $this->newWatchedItemStore(
$mockCache->expects( $this->never() )->method( 'delete' );
$store = $this->newWatchedItemStore(
- $this->getMockLoadBalancer( $mockDb ),
+ $this->getMockLBFactory( $mockDb ),
$mockCache,
$this->getMockReadOnlyMode()
);
$mockCache,
$this->getMockReadOnlyMode()
);
$mockCache->expects( $this->never() )->method( 'delete' );
$store = $this->newWatchedItemStore(
$mockCache->expects( $this->never() )->method( 'delete' );
$store = $this->newWatchedItemStore(
- $this->getMockLoadBalancer( $mockDb ),
+ $this->getMockLBFactory( $mockDb ),
$mockCache,
$this->getMockReadOnlyMode()
);
$mockCache,
$this->getMockReadOnlyMode()
);
$mockCache->expects( $this->never() )->method( 'delete' );
$store = $this->newWatchedItemStore(
$mockCache->expects( $this->never() )->method( 'delete' );
$store = $this->newWatchedItemStore(
- $this->getMockLoadBalancer( $mockDb ),
+ $this->getMockLBFactory( $mockDb ),
$mockCache,
$this->getMockReadOnlyMode()
);
$mockCache,
$this->getMockReadOnlyMode()
);
$mockCache->expects( $this->never() )->method( 'delete' );
$store = $this->newWatchedItemStore(
$mockCache->expects( $this->never() )->method( 'delete' );
$store = $this->newWatchedItemStore(
- $this->getMockLoadBalancer( $mockDb ),
+ $this->getMockLBFactory( $mockDb ),
$mockCache,
$this->getMockReadOnlyMode()
);
$mockCache,
$this->getMockReadOnlyMode()
);
$mockCache->expects( $this->never() )->method( 'delete' );
$store = $this->newWatchedItemStore(
$mockCache->expects( $this->never() )->method( 'delete' );
$store = $this->newWatchedItemStore(
- $this->getMockLoadBalancer( $mockDb ),
+ $this->getMockLBFactory( $mockDb ),
$mockCache,
$this->getMockReadOnlyMode()
);
$mockCache,
$this->getMockReadOnlyMode()
);
$mockCache->expects( $this->never() )->method( 'delete' );
$store = $this->newWatchedItemStore(
$mockCache->expects( $this->never() )->method( 'delete' );
$store = $this->newWatchedItemStore(
- $this->getMockLoadBalancer( $mockDb ),
+ $this->getMockLBFactory( $mockDb ),
$mockCache,
$this->getMockReadOnlyMode()
);
$mockCache,
$this->getMockReadOnlyMode()
);
->will( $this->returnValue( new FakeResultWrapper( [] ) ) );
$store = $this->newWatchedItemStore(
->will( $this->returnValue( new FakeResultWrapper( [] ) ) );
$store = $this->newWatchedItemStore(
- $this->getMockLoadBalancer( $mockDb ),
+ $this->getMockLBFactory( $mockDb ),
$this->getMockCache(),
$this->getMockReadOnlyMode()
);
$this->getMockCache(),
$this->getMockReadOnlyMode()
);
$mockCache->expects( $this->never() )->method( 'delete' );
$store = $this->newWatchedItemStore(
$mockCache->expects( $this->never() )->method( 'delete' );
$store = $this->newWatchedItemStore(
- $this->getMockLoadBalancer( $mockDb ),
+ $this->getMockLBFactory( $mockDb ),
$mockCache,
$this->getMockReadOnlyMode()
);
$mockCache,
$this->getMockReadOnlyMode()
);
$mockCache->expects( $this->never() )->method( 'delete' );
$store = $this->newWatchedItemStore(
$mockCache->expects( $this->never() )->method( 'delete' );
$store = $this->newWatchedItemStore(
- $this->getMockLoadBalancer( $mockDb ),
+ $this->getMockLBFactory( $mockDb ),
$mockCache,
$this->getMockReadOnlyMode()
);
$mockCache,
$this->getMockReadOnlyMode()
);
$mockCache->expects( $this->never() )->method( 'delete' );
$store = $this->newWatchedItemStore(
$mockCache->expects( $this->never() )->method( 'delete' );
$store = $this->newWatchedItemStore(
- $this->getMockLoadBalancer( $mockDb ),
+ $this->getMockLBFactory( $mockDb ),
$mockCache,
$this->getMockReadOnlyMode()
);
$mockCache,
$this->getMockReadOnlyMode()
);
->with( '0:Some_Page:1' );
$store = $this->newWatchedItemStore(
->with( '0:Some_Page:1' );
$store = $this->newWatchedItemStore(
- $this->getMockLoadBalancer( $mockDb ),
+ $this->getMockLBFactory( $mockDb ),
$mockCache,
$this->getMockReadOnlyMode()
);
$mockCache,
$this->getMockReadOnlyMode()
);
->method( 'delete' );
$store = $this->newWatchedItemStore(
->method( 'delete' );
$store = $this->newWatchedItemStore(
- $this->getMockLoadBalancer( $mockDb ),
+ $this->getMockLBFactory( $mockDb ),
$mockCache,
$this->getMockReadOnlyMode()
);
$mockCache,
$this->getMockReadOnlyMode()
);
public function testAddWatchBatchForUser_readOnlyDBReturnsFalse() {
$store = $this->newWatchedItemStore(
public function testAddWatchBatchForUser_readOnlyDBReturnsFalse() {
$store = $this->newWatchedItemStore(
- $this->getMockLoadBalancer( $this->getMockDb() ),
+ $this->getMockLBFactory( $this->getMockDb() ),
$this->getMockCache(),
$this->getMockReadOnlyMode( true )
);
$this->getMockCache(),
$this->getMockReadOnlyMode( true )
);
->with( '1:Some_Page:1' );
$store = $this->newWatchedItemStore(
->with( '1:Some_Page:1' );
$store = $this->newWatchedItemStore(
- $this->getMockLoadBalancer( $mockDb ),
+ $this->getMockLBFactory( $mockDb ),
$mockCache,
$this->getMockReadOnlyMode()
);
$mockCache,
$this->getMockReadOnlyMode()
);
->method( 'delete' );
$store = $this->newWatchedItemStore(
->method( 'delete' );
$store = $this->newWatchedItemStore(
- $this->getMockLoadBalancer( $mockDb ),
+ $this->getMockLBFactory( $mockDb ),
$mockCache,
$this->getMockReadOnlyMode()
);
$mockCache,
$this->getMockReadOnlyMode()
);
->method( 'delete' );
$store = $this->newWatchedItemStore(
->method( 'delete' );
$store = $this->newWatchedItemStore(
- $this->getMockLoadBalancer( $mockDb ),
+ $this->getMockLBFactory( $mockDb ),
$mockCache,
$this->getMockReadOnlyMode()
);
$mockCache,
$this->getMockReadOnlyMode()
);
);
$store = $this->newWatchedItemStore(
);
$store = $this->newWatchedItemStore(
- $this->getMockLoadBalancer( $mockDb ),
+ $this->getMockLBFactory( $mockDb ),
$mockCache,
$this->getMockReadOnlyMode()
);
$mockCache,
$this->getMockReadOnlyMode()
);
$mockCache->expects( $this->never() )->method( 'delete' );
$store = $this->newWatchedItemStore(
$mockCache->expects( $this->never() )->method( 'delete' );
$store = $this->newWatchedItemStore(
- $this->getMockLoadBalancer( $mockDb ),
+ $this->getMockLBFactory( $mockDb ),
$mockCache,
$this->getMockReadOnlyMode()
);
$mockCache,
$this->getMockReadOnlyMode()
);
$mockCache->expects( $this->never() )->method( 'delete' );
$store = $this->newWatchedItemStore(
$mockCache->expects( $this->never() )->method( 'delete' );
$store = $this->newWatchedItemStore(
- $this->getMockLoadBalancer( $mockDb ),
+ $this->getMockLBFactory( $mockDb ),
$mockCache,
$this->getMockReadOnlyMode()
);
$mockCache,
$this->getMockReadOnlyMode()
);
->with( '0:SomeDbKey:1' );
$store = $this->newWatchedItemStore(
->with( '0:SomeDbKey:1' );
$store = $this->newWatchedItemStore(
- $this->getMockLoadBalancer( $mockDb ),
+ $this->getMockLBFactory( $mockDb ),
$mockCache,
$this->getMockReadOnlyMode()
);
$mockCache,
$this->getMockReadOnlyMode()
);
->with( '0:SomeDbKey:1' );
$store = $this->newWatchedItemStore(
->with( '0:SomeDbKey:1' );
$store = $this->newWatchedItemStore(
- $this->getMockLoadBalancer( $mockDb ),
+ $this->getMockLBFactory( $mockDb ),
$mockCache,
$this->getMockReadOnlyMode()
);
$mockCache,
$this->getMockReadOnlyMode()
);
->method( 'delete' );
$store = $this->newWatchedItemStore(
->method( 'delete' );
$store = $this->newWatchedItemStore(
- $this->getMockLoadBalancer( $mockDb ),
+ $this->getMockLBFactory( $mockDb ),
$mockCache,
$this->getMockReadOnlyMode()
);
$mockCache,
$this->getMockReadOnlyMode()
);
);
$store = $this->newWatchedItemStore(
);
$store = $this->newWatchedItemStore(
- $this->getMockLoadBalancer( $mockDb ),
+ $this->getMockLBFactory( $mockDb ),
$mockCache,
$this->getMockReadOnlyMode()
);
$mockCache,
$this->getMockReadOnlyMode()
);
->will( $this->returnValue( $cachedItem ) );
$store = $this->newWatchedItemStore(
->will( $this->returnValue( $cachedItem ) );
$store = $this->newWatchedItemStore(
- $this->getMockLoadBalancer( $mockDb ),
+ $this->getMockLBFactory( $mockDb ),
$mockCache,
$this->getMockReadOnlyMode()
);
$mockCache,
$this->getMockReadOnlyMode()
);
->will( $this->returnValue( false ) );
$store = $this->newWatchedItemStore(
->will( $this->returnValue( false ) );
$store = $this->newWatchedItemStore(
- $this->getMockLoadBalancer( $mockDb ),
+ $this->getMockLBFactory( $mockDb ),
$mockCache,
$this->getMockReadOnlyMode()
);
$mockCache,
$this->getMockReadOnlyMode()
);
$mockCache->expects( $this->never() )->method( 'delete' );
$store = $this->newWatchedItemStore(
$mockCache->expects( $this->never() )->method( 'delete' );
$store = $this->newWatchedItemStore(
- $this->getMockLoadBalancer( $mockDb ),
+ $this->getMockLBFactory( $mockDb ),
$mockCache,
$this->getMockReadOnlyMode()
);
$mockCache,
$this->getMockReadOnlyMode()
);
$mockCache->expects( $this->never() )->method( 'set' );
$store = $this->newWatchedItemStore(
$mockCache->expects( $this->never() )->method( 'set' );
$store = $this->newWatchedItemStore(
- $this->getMockLoadBalancer( $mockDb ),
+ $this->getMockLBFactory( $mockDb ),
$mockCache,
$this->getMockReadOnlyMode()
);
$mockCache,
$this->getMockReadOnlyMode()
);
public function testGetWatchedItemsForUser_optionsAndEmptyResult( $forWrite, $dbType ) {
$mockDb = $this->getMockDb();
$mockCache = $this->getMockCache();
public function testGetWatchedItemsForUser_optionsAndEmptyResult( $forWrite, $dbType ) {
$mockDb = $this->getMockDb();
$mockCache = $this->getMockCache();
- $mockLoadBalancer = $this->getMockLoadBalancer( $mockDb, $dbType );
+ $mockLoadBalancer = $this->getMockLBFactory( $mockDb, $dbType );
$user = $this->getMockNonAnonUserWithId( 1 );
$mockDb->expects( $this->once() )
$user = $this->getMockNonAnonUserWithId( 1 );
$mockDb->expects( $this->once() )
public function testGetWatchedItemsForUser_badSortOptionThrowsException() {
$store = $this->newWatchedItemStore(
public function testGetWatchedItemsForUser_badSortOptionThrowsException() {
$store = $this->newWatchedItemStore(
- $this->getMockLoadBalancer( $this->getMockDb() ),
+ $this->getMockLBFactory( $this->getMockDb() ),
$this->getMockCache(),
$this->getMockReadOnlyMode()
);
$this->getMockCache(),
$this->getMockReadOnlyMode()
);
);
$store = $this->newWatchedItemStore(
);
$store = $this->newWatchedItemStore(
- $this->getMockLoadBalancer( $mockDb ),
+ $this->getMockLBFactory( $mockDb ),
$mockCache,
$this->getMockReadOnlyMode()
);
$mockCache,
$this->getMockReadOnlyMode()
);
->will( $this->returnValue( false ) );
$store = $this->newWatchedItemStore(
->will( $this->returnValue( false ) );
$store = $this->newWatchedItemStore(
- $this->getMockLoadBalancer( $mockDb ),
+ $this->getMockLBFactory( $mockDb ),
$mockCache,
$this->getMockReadOnlyMode()
);
$mockCache,
$this->getMockReadOnlyMode()
);
$mockCache->expects( $this->never() )->method( 'delete' );
$store = $this->newWatchedItemStore(
$mockCache->expects( $this->never() )->method( 'delete' );
$store = $this->newWatchedItemStore(
- $this->getMockLoadBalancer( $mockDb ),
+ $this->getMockLBFactory( $mockDb ),
$mockCache,
$this->getMockReadOnlyMode()
);
$mockCache,
$this->getMockReadOnlyMode()
);
$mockCache->expects( $this->never() )->method( 'delete' );
$store = $this->newWatchedItemStore(
$mockCache->expects( $this->never() )->method( 'delete' );
$store = $this->newWatchedItemStore(
- $this->getMockLoadBalancer( $mockDb ),
+ $this->getMockLBFactory( $mockDb ),
$mockCache,
$this->getMockReadOnlyMode()
);
$mockCache,
$this->getMockReadOnlyMode()
);
$mockCache->expects( $this->never() )->method( 'delete' );
$store = $this->newWatchedItemStore(
$mockCache->expects( $this->never() )->method( 'delete' );
$store = $this->newWatchedItemStore(
- $this->getMockLoadBalancer( $mockDb ),
+ $this->getMockLBFactory( $mockDb ),
$mockCache,
$this->getMockReadOnlyMode()
);
$mockCache,
$this->getMockReadOnlyMode()
);
$mockCache->expects( $this->never() )->method( 'delete' );
$store = $this->newWatchedItemStore(
$mockCache->expects( $this->never() )->method( 'delete' );
$store = $this->newWatchedItemStore(
- $this->getMockLoadBalancer( $mockDb ),
+ $this->getMockLBFactory( $mockDb ),
$mockCache,
$this->getMockReadOnlyMode()
);
$mockCache,
$this->getMockReadOnlyMode()
);
$mockCache->expects( $this->never() )->method( 'delete' );
$store = $this->newWatchedItemStore(
$mockCache->expects( $this->never() )->method( 'delete' );
$store = $this->newWatchedItemStore(
- $this->getMockLoadBalancer( $mockDb ),
+ $this->getMockLBFactory( $mockDb ),
$mockCache,
$this->getMockReadOnlyMode()
);
$mockCache,
$this->getMockReadOnlyMode()
);
$mockCache->expects( $this->never() )->method( $this->anything() );
$store = $this->newWatchedItemStore(
$mockCache->expects( $this->never() )->method( $this->anything() );
$store = $this->newWatchedItemStore(
- $this->getMockLoadBalancer( $mockDb ),
+ $this->getMockLBFactory( $mockDb ),
$mockCache,
$this->getMockReadOnlyMode()
);
$mockCache,
$this->getMockReadOnlyMode()
);
$mockCache->expects( $this->never() )->method( 'delete' );
$store = $this->newWatchedItemStore(
$mockCache->expects( $this->never() )->method( 'delete' );
$store = $this->newWatchedItemStore(
- $this->getMockLoadBalancer( $mockDb ),
+ $this->getMockLBFactory( $mockDb ),
$mockCache,
$this->getMockReadOnlyMode()
);
$mockCache,
$this->getMockReadOnlyMode()
);
$mockCache->expects( $this->never() )->method( 'delete' );
$store = $this->newWatchedItemStore(
$mockCache->expects( $this->never() )->method( 'delete' );
$store = $this->newWatchedItemStore(
- $this->getMockLoadBalancer( $mockDb ),
+ $this->getMockLBFactory( $mockDb ),
$mockCache,
$this->getMockReadOnlyMode()
);
$mockCache,
$this->getMockReadOnlyMode()
);
->with( '0:SomeDbKey:1' );
$store = $this->newWatchedItemStore(
->with( '0:SomeDbKey:1' );
$store = $this->newWatchedItemStore(
- $this->getMockLoadBalancer( $mockDb ),
+ $this->getMockLBFactory( $mockDb ),
$mockCache,
$this->getMockReadOnlyMode()
);
$mockCache,
$this->getMockReadOnlyMode()
);
->with( '0:SomeDbKey:1' );
$store = $this->newWatchedItemStore(
->with( '0:SomeDbKey:1' );
$store = $this->newWatchedItemStore(
- $this->getMockLoadBalancer( $mockDb ),
+ $this->getMockLBFactory( $mockDb ),
$mockCache,
$this->getMockReadOnlyMode()
);
$mockCache,
$this->getMockReadOnlyMode()
);
->with( '0:SomeTitle:1' );
$store = $this->newWatchedItemStore(
->with( '0:SomeTitle:1' );
$store = $this->newWatchedItemStore(
- $this->getMockLoadBalancer( $mockDb ),
+ $this->getMockLBFactory( $mockDb ),
$mockCache,
$this->getMockReadOnlyMode()
);
$mockCache,
$this->getMockReadOnlyMode()
);
->with( '0:SomeDbKey:1' );
$store = $this->newWatchedItemStore(
->with( '0:SomeDbKey:1' );
$store = $this->newWatchedItemStore(
- $this->getMockLoadBalancer( $mockDb ),
+ $this->getMockLBFactory( $mockDb ),
$mockCache,
$this->getMockReadOnlyMode()
);
$mockCache,
$this->getMockReadOnlyMode()
);
->with( '0:SomeDbKey:1' );
$store = $this->newWatchedItemStore(
->with( '0:SomeDbKey:1' );
$store = $this->newWatchedItemStore(
- $this->getMockLoadBalancer( $mockDb ),
+ $this->getMockLBFactory( $mockDb ),
$mockCache,
$this->getMockReadOnlyMode()
);
$mockCache,
$this->getMockReadOnlyMode()
);
->with( '0:SomeDbKey:1' );
$store = $this->newWatchedItemStore(
->with( '0:SomeDbKey:1' );
$store = $this->newWatchedItemStore(
- $this->getMockLoadBalancer( $mockDb ),
+ $this->getMockLBFactory( $mockDb ),
$mockCache,
$this->getMockReadOnlyMode()
);
$mockCache,
$this->getMockReadOnlyMode()
);
->with( '0:SomeDbKey:1' );
$store = $this->newWatchedItemStore(
->with( '0:SomeDbKey:1' );
$store = $this->newWatchedItemStore(
- $this->getMockLoadBalancer( $mockDb ),
+ $this->getMockLBFactory( $mockDb ),
$mockCache,
$this->getMockReadOnlyMode()
);
$mockCache,
$this->getMockReadOnlyMode()
);
public function testSetNotificationTimestampsForUser_anonUser() {
$store = $this->newWatchedItemStore(
public function testSetNotificationTimestampsForUser_anonUser() {
$store = $this->newWatchedItemStore(
- $this->getMockLoadBalancer( $this->getMockDb() ),
+ $this->getMockLBFactory( $this->getMockDb() ),
$this->getMockCache(),
$this->getMockReadOnlyMode()
);
$this->getMockCache(),
$this->getMockReadOnlyMode()
);
} ) );
$store = $this->newWatchedItemStore(
} ) );
$store = $this->newWatchedItemStore(
- $this->getMockLoadBalancer( $mockDb ),
+ $this->getMockLBFactory( $mockDb ),
$this->getMockCache(),
$this->getMockReadOnlyMode()
);
$this->getMockCache(),
$this->getMockReadOnlyMode()
);
} ) );
$store = $this->newWatchedItemStore(
} ) );
$store = $this->newWatchedItemStore(
- $this->getMockLoadBalancer( $mockDb ),
+ $this->getMockLBFactory( $mockDb ),
$this->getMockCache(),
$this->getMockReadOnlyMode()
);
$this->getMockCache(),
$this->getMockReadOnlyMode()
);
->will( $this->returnValue( 'makeWhereFrom2d return value' ) );
$store = $this->newWatchedItemStore(
->will( $this->returnValue( 'makeWhereFrom2d return value' ) );
$store = $this->newWatchedItemStore(
- $this->getMockLoadBalancer( $mockDb ),
+ $this->getMockLBFactory( $mockDb ),
$this->getMockCache(),
$this->getMockReadOnlyMode()
);
$this->getMockCache(),
$this->getMockReadOnlyMode()
);
$mockCache->expects( $this->never() )->method( 'delete' );
$store = $this->newWatchedItemStore(
$mockCache->expects( $this->never() )->method( 'delete' );
$store = $this->newWatchedItemStore(
- $this->getMockLoadBalancer( $mockDb ),
+ $this->getMockLBFactory( $mockDb ),
$mockCache,
$this->getMockReadOnlyMode()
);
$mockCache,
$this->getMockReadOnlyMode()
);
$mockCache->expects( $this->never() )->method( 'delete' );
$store = $this->newWatchedItemStore(
$mockCache->expects( $this->never() )->method( 'delete' );
$store = $this->newWatchedItemStore(
- $this->getMockLoadBalancer( $mockDb ),
+ $this->getMockLBFactory( $mockDb ),
$mockCache,
$this->getMockReadOnlyMode()
);
$mockCache,
$this->getMockReadOnlyMode()
);
->with( '0:SomeDbKey:1' );
$store = $this->newWatchedItemStore(
->with( '0:SomeDbKey:1' );
$store = $this->newWatchedItemStore(
- $this->getMockLoadBalancer( $mockDb ),
+ $this->getMockLBFactory( $mockDb ),
$mockCache,
$this->getMockReadOnlyMode()
);
$mockCache,
$this->getMockReadOnlyMode()
);