From 14f74d141ab5580688bfd46d2f74c026e43ed967 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Wed, 1 Apr 2015 06:11:44 +0200 Subject: Update to MediaWiki 1.24.2 --- tests/phpunit/includes/db/LBFactoryTest.php | 61 +++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 tests/phpunit/includes/db/LBFactoryTest.php (limited to 'tests/phpunit/includes/db/LBFactoryTest.php') diff --git a/tests/phpunit/includes/db/LBFactoryTest.php b/tests/phpunit/includes/db/LBFactoryTest.php new file mode 100644 index 00000000..4c59f474 --- /dev/null +++ b/tests/phpunit/includes/db/LBFactoryTest.php @@ -0,0 +1,61 @@ +getMockBuilder( 'DatabaseMysql' ) + ->disableOriginalConstructor() + ->getMock(); + + $config = array( + 'class' => $deprecated, + 'connection' => $mockDB, + # Various other parameters required: + 'sectionsByDB' => array(), + 'sectionLoads' => array(), + 'serverTemplate' => array(), + ); + + $this->hideDeprecated( '$wgLBFactoryConf must be updated. See RELEASE-NOTES for details' ); + $result = LBFactory::getLBFactoryClass( $config ); + + $this->assertEquals( $expected, $result ); + } + + public function getLBFactoryClassProvider() { + return array( + # Format: new class, old class + array( 'LBFactorySimple', 'LBFactory_Simple' ), + array( 'LBFactorySingle', 'LBFactory_Single' ), + array( 'LBFactoryMulti', 'LBFactory_Multi' ), + array( 'LBFactoryFake', 'LBFactory_Fake' ), + ); + } +} -- cgit v1.2.2