MediaWiki  master
LoadBalancerTest Class Reference

Database medium \Wikimedia\Rdbms\LoadBalancer. More...

Inheritance diagram for LoadBalancerTest:
Collaboration diagram for LoadBalancerTest:

Public Member Functions

 testDBConnRefReadsMasterAndReplicaRoles ()
 \Wikimedia\Rdbms\LoadBalancer::getConnectionRef \Wikimedia\Rdbms\LoadBalancer::getConnection() More...
 
 testDBConnRefWritesReplicaRole ()
 \Wikimedia\Rdbms\LoadBalancer::getConnectionRef \Wikimedia\Rdbms\DBReadOnlyRoleError More...
 
 testDBConnRefWritesReplicaRoleIndex ()
 \Wikimedia\Rdbms\LoadBalancer::getConnectionRef \Wikimedia\Rdbms\DBReadOnlyRoleError More...
 
 testDBConnRefWritesReplicaRoleInsert ()
 \Wikimedia\Rdbms\LoadBalancer::getConnectionRef \Wikimedia\Rdbms\DBReadOnlyRoleError More...
 
 testGetConnectionRefDefaultGroup ()
 \Wikimedia\Rdbms\LoadBalancer::getConnection() More...
 
 testGetConnectionRefUnknownDefaultGroup ()
 \Wikimedia\Rdbms\LoadBalancer::getConnection() More...
 
 testGetLazyConnectionRef ()
 \Wikimedia\Rdbms\LoadBalancer::getLazyConnectionRef More...
 
 testNonZeroMasterLoad ()
 
 testOpenConnection ()
 \Wikimedia\Rdbms\LoadBalancer::getConnection() \Wikimedia\Rdbms\LoadBalancer::openConnection() \Wikimedia\Rdbms\LoadBalancer::getAnyOpenConnection() \Wikimedia\Rdbms\LoadBalancer::getWriterIndex() More...
 
 testQueryGroupIndex ()
 \Wikimedia\Rdbms\LoadBalancer::getConnection() \Wikimedia\Rdbms\LoadBalancer::getMaintenanceConnectionRef() More...
 
 testServerAttributes ()
 
 testTransactionCallbackChains ()
 \Wikimedia\Rdbms\LoadBalancer::openConnection() \Wikimedia\Rdbms\LoadBalancer::getWriterIndex() \Wikimedia\Rdbms\LoadBalancer::forEachOpenMasterConnection() \Wikimedia\Rdbms\LoadBalancer::setTransactionListener() \Wikimedia\Rdbms\LoadBalancer::beginMasterChanges() \Wikimedia\Rdbms\LoadBalancer::finalizeMasterChanges() \Wikimedia\Rdbms\LoadBalancer::approveMasterChanges() \Wikimedia\Rdbms\LoadBalancer::commitMasterChanges() \Wikimedia\Rdbms\LoadBalancer::runMasterTransactionIdleCallbacks() \Wikimedia\Rdbms\LoadBalancer::runMasterTransactionListenerCallbacks() More...
 
 testWithoutReplica ()
 \Wikimedia\Rdbms\LoadBalancer::getConnection() \Wikimedia\Rdbms\LoadBalancer::getLocalDomainID() \Wikimedia\Rdbms\LoadBalancer::resolveDomainID() \Wikimedia\Rdbms\LoadBalancer::haveIndex() \Wikimedia\Rdbms\LoadBalancer::isNonZeroLoad() More...
 
 testWithReplica ()
 \Wikimedia\Rdbms\LoadBalancer::getConnection() \Wikimedia\Rdbms\LoadBalancer::getReaderIndex() \Wikimedia\Rdbms\LoadBalancer::getWriterIndex() \Wikimedia\Rdbms\LoadBalancer::haveIndex() \Wikimedia\Rdbms\LoadBalancer::isNonZeroLoad() \Wikimedia\Rdbms\LoadBalancer::getServerName() \Wikimedia\Rdbms\LoadBalancer::getServerInfo() \Wikimedia\Rdbms\LoadBalancer::getServerType() \Wikimedia\Rdbms\LoadBalancer::getServerAttributes() More...
 

Private Member Functions

 assertWriteAllowed (Database $db)
 
 assertWriteForbidden (Database $db)
 
 makeServerConfig ( $flags=DBO_DEFAULT)
 
 newMultiServerLocalLoadBalancer ( $lbExtra=[], $srvExtra=[], $masterOnly=false)
 
 newSingleServerLocalLoadBalancer ()
 

Detailed Description

Database medium \Wikimedia\Rdbms\LoadBalancer.

Definition at line 36 of file LoadBalancerTest.php.

Member Function Documentation

◆ assertWriteAllowed()

◆ assertWriteForbidden()

LoadBalancerTest::assertWriteForbidden ( Database  $db)
private

Definition at line 326 of file LoadBalancerTest.php.

References Wikimedia\Rdbms\Database\delete(), and true.

Referenced by testWithReplica().

◆ makeServerConfig()

LoadBalancerTest::makeServerConfig (   $flags = DBO_DEFAULT)
private

◆ newMultiServerLocalLoadBalancer()

◆ newSingleServerLocalLoadBalancer()

LoadBalancerTest::newSingleServerLocalLoadBalancer ( )
private

◆ testDBConnRefReadsMasterAndReplicaRoles()

LoadBalancerTest::testDBConnRefReadsMasterAndReplicaRoles ( )

\Wikimedia\Rdbms\LoadBalancer::getConnectionRef \Wikimedia\Rdbms\LoadBalancer::getConnection()

Definition at line 580 of file LoadBalancerTest.php.

References $res, as, DB_MASTER, DB_REPLICA, DBO_TRX, and newSingleServerLocalLoadBalancer().

◆ testDBConnRefWritesReplicaRole()

LoadBalancerTest::testDBConnRefWritesReplicaRole ( )

\Wikimedia\Rdbms\LoadBalancer::getConnectionRef \Wikimedia\Rdbms\DBReadOnlyRoleError

Definition at line 607 of file LoadBalancerTest.php.

References DB_REPLICA, and newSingleServerLocalLoadBalancer().

◆ testDBConnRefWritesReplicaRoleIndex()

LoadBalancerTest::testDBConnRefWritesReplicaRoleIndex ( )

\Wikimedia\Rdbms\LoadBalancer::getConnectionRef \Wikimedia\Rdbms\DBReadOnlyRoleError

Definition at line 619 of file LoadBalancerTest.php.

References newMultiServerLocalLoadBalancer().

◆ testDBConnRefWritesReplicaRoleInsert()

LoadBalancerTest::testDBConnRefWritesReplicaRoleInsert ( )

\Wikimedia\Rdbms\LoadBalancer::getConnectionRef \Wikimedia\Rdbms\DBReadOnlyRoleError

Definition at line 631 of file LoadBalancerTest.php.

References DB_REPLICA, and newMultiServerLocalLoadBalancer().

◆ testGetConnectionRefDefaultGroup()

LoadBalancerTest::testGetConnectionRefDefaultGroup ( )

\Wikimedia\Rdbms\LoadBalancer::getConnection()

Definition at line 642 of file LoadBalancerTest.php.

References DB_REPLICA, and newMultiServerLocalLoadBalancer().

◆ testGetConnectionRefUnknownDefaultGroup()

LoadBalancerTest::testGetConnectionRefUnknownDefaultGroup ( )

\Wikimedia\Rdbms\LoadBalancer::getConnection()

Definition at line 655 of file LoadBalancerTest.php.

References class, DB_REPLICA, and newMultiServerLocalLoadBalancer().

◆ testGetLazyConnectionRef()

LoadBalancerTest::testGetLazyConnectionRef ( )

\Wikimedia\Rdbms\LoadBalancer::getLazyConnectionRef

Definition at line 728 of file LoadBalancerTest.php.

References DB_MASTER, and newMultiServerLocalLoadBalancer().

◆ testNonZeroMasterLoad()

LoadBalancerTest::testNonZeroMasterLoad ( )

Definition at line 718 of file LoadBalancerTest.php.

References DB_REPLICA, DBO_DEFAULT, and newMultiServerLocalLoadBalancer().

◆ testOpenConnection()

LoadBalancerTest::testOpenConnection ( )

\Wikimedia\Rdbms\LoadBalancer::getConnection() \Wikimedia\Rdbms\LoadBalancer::openConnection() \Wikimedia\Rdbms\LoadBalancer::getAnyOpenConnection() \Wikimedia\Rdbms\LoadBalancer::getWriterIndex()

Definition at line 433 of file LoadBalancerTest.php.

References $e, DBO_TRX, newSingleServerLocalLoadBalancer(), and null.

◆ testQueryGroupIndex()

LoadBalancerTest::testQueryGroupIndex ( )

\Wikimedia\Rdbms\LoadBalancer::getConnection() \Wikimedia\Rdbms\LoadBalancer::getMaintenanceConnectionRef()

Definition at line 668 of file LoadBalancerTest.php.

References DB_REPLICA, and newMultiServerLocalLoadBalancer().

◆ testServerAttributes()

LoadBalancerTest::testServerAttributes ( )

Definition at line 378 of file LoadBalancerTest.php.

References class, and null.

◆ testTransactionCallbackChains()

LoadBalancerTest::testTransactionCallbackChains ( )

\Wikimedia\Rdbms\LoadBalancer::openConnection() \Wikimedia\Rdbms\LoadBalancer::getWriterIndex() \Wikimedia\Rdbms\LoadBalancer::forEachOpenMasterConnection() \Wikimedia\Rdbms\LoadBalancer::setTransactionListener() \Wikimedia\Rdbms\LoadBalancer::beginMasterChanges() \Wikimedia\Rdbms\LoadBalancer::finalizeMasterChanges() \Wikimedia\Rdbms\LoadBalancer::approveMasterChanges() \Wikimedia\Rdbms\LoadBalancer::commitMasterChanges() \Wikimedia\Rdbms\LoadBalancer::runMasterTransactionIdleCallbacks() \Wikimedia\Rdbms\LoadBalancer::runMasterTransactionListenerCallbacks()

Definition at line 489 of file LoadBalancerTest.php.

References $wgDBname, $wgDBpassword, $wgDBserver, $wgDBtype, $wgDBuser, $wgSQLiteDataDir, DBO_TRX, false, null, and use.

◆ testWithoutReplica()

LoadBalancerTest::testWithoutReplica ( )

\Wikimedia\Rdbms\LoadBalancer::getConnection() \Wikimedia\Rdbms\LoadBalancer::getLocalDomainID() \Wikimedia\Rdbms\LoadBalancer::resolveDomainID() \Wikimedia\Rdbms\LoadBalancer::haveIndex() \Wikimedia\Rdbms\LoadBalancer::isNonZeroLoad()

Definition at line 60 of file LoadBalancerTest.php.

References $dbr, $wgDBname, assertWriteAllowed(), DB_MASTER, DB_REPLICA, DBO_TRX, makeServerConfig(), null, and use.

◆ testWithReplica()

LoadBalancerTest::testWithReplica ( )

\Wikimedia\Rdbms\LoadBalancer::getConnection() \Wikimedia\Rdbms\LoadBalancer::getReaderIndex() \Wikimedia\Rdbms\LoadBalancer::getWriterIndex() \Wikimedia\Rdbms\LoadBalancer::haveIndex() \Wikimedia\Rdbms\LoadBalancer::isNonZeroLoad() \Wikimedia\Rdbms\LoadBalancer::getServerName() \Wikimedia\Rdbms\LoadBalancer::getServerInfo() \Wikimedia\Rdbms\LoadBalancer::getServerType() \Wikimedia\Rdbms\LoadBalancer::getServerAttributes()

Definition at line 134 of file LoadBalancerTest.php.

References $dbr, $wgDBserver, assertWriteAllowed(), assertWriteForbidden(), DB_MASTER, DB_REPLICA, DBO_TRX, and newMultiServerLocalLoadBalancer().


The documentation for this class was generated from the following file: