Avoid interacting with LBFactory singleton in tests
authoraude <aude.wiki@gmail.com>
Sun, 29 Dec 2013 21:00:39 +0000 (22:00 +0100)
committeraude <aude.wiki@gmail.com>
Thu, 2 Jan 2014 13:27:19 +0000 (14:27 +0100)
commit1959b3eb5ac162cac0db4591173186dd4078aa1e
treeb3e1c835b029b45c416c12e1b342a86019194f64
parent8c76d65f3f3cacd6cef7ab69802bd7243dc1666b
Avoid interacting with LBFactory singleton in tests

Instead test that LBFactory::getLBFactoryClass() does the right thing.

In LBFactory::getLBFactoryClass(), the method now requires a configuration
array as a parameter, and returns the class name as a string.

LBFactory::singleton() now passes in $wgLBFactoryConf into getLBFactoryClass(),
while tests can use test configuration.

Only use of LBFactory::getLBFactoryClass() in core is in LBFactory::singleton().

No extension in gerrit uses getLBFactoryClass() and I can find no use of it
when searching places like Github and Google, so it should be safe to make
such change in LBFactory.

Bug: 59105
Change-Id: I71ae7df16bc5c214b9389125140bca5ce68d274c
includes/db/LBFactory.php
tests/phpunit/includes/db/LBFactoryTest.php