MediaWiki  1.30.0
LBFactoryTest.php
Go to the documentation of this file.
1 <?php
2 
7 
33 
37  public function testGetLBFactoryClass( $expected, $deprecated ) {
38  $mockDB = $this->getMockBuilder( 'DatabaseMysqli' )
39  ->disableOriginalConstructor()
40  ->getMock();
41 
42  $config = [
43  'class' => $deprecated,
44  'connection' => $mockDB,
45  # Various other parameters required:
46  'sectionsByDB' => [],
47  'sectionLoads' => [],
48  'serverTemplate' => [],
49  ];
50 
51  $this->hideDeprecated( '$wgLBFactoryConf must be updated. See RELEASE-NOTES for details' );
53 
54  $this->assertEquals( $expected, $result );
55  }
56 
57  public function getLBFactoryClassProvider() {
58  return [
59  # Format: new class, old class
60  [ Wikimedia\Rdbms\LBFactorySimple::class, 'LBFactory_Simple' ],
61  [ Wikimedia\Rdbms\LBFactorySingle::class, 'LBFactory_Single' ],
62  [ Wikimedia\Rdbms\LBFactoryMulti::class, 'LBFactory_Multi' ],
63  [ Wikimedia\Rdbms\LBFactorySimple::class, 'LBFactorySimple' ],
64  [ Wikimedia\Rdbms\LBFactorySingle::class, 'LBFactorySingle' ],
65  [ Wikimedia\Rdbms\LBFactoryMulti::class, 'LBFactoryMulti' ],
66  ];
67  }
68 
69  public function testLBFactorySimpleServer() {
71 
72  $servers = [
73  [
74  'host' => $wgDBserver,
75  'dbname' => $wgDBname,
76  'user' => $wgDBuser,
77  'password' => $wgDBpassword,
78  'type' => $wgDBtype,
79  'dbDirectory' => $wgSQLiteDataDir,
80  'load' => 0,
81  'flags' => DBO_TRX // REPEATABLE-READ for consistency
82  ],
83  ];
84 
85  $factory = new LBFactorySimple( [ 'servers' => $servers ] );
86  $lb = $factory->getMainLB();
87 
88  $dbw = $lb->getConnection( DB_MASTER );
89  $this->assertTrue( $dbw->getLBInfo( 'master' ), 'master shows as master' );
90 
91  $dbr = $lb->getConnection( DB_REPLICA );
92  $this->assertTrue( $dbr->getLBInfo( 'master' ), 'DB_REPLICA also gets the master' );
93 
94  $factory->shutdown();
95  $lb->closeAll();
96  }
97 
98  public function testLBFactorySimpleServers() {
100 
101  $servers = [
102  [ // master
103  'host' => $wgDBserver,
104  'dbname' => $wgDBname,
105  'user' => $wgDBuser,
106  'password' => $wgDBpassword,
107  'type' => $wgDBtype,
108  'dbDirectory' => $wgSQLiteDataDir,
109  'load' => 0,
110  'flags' => DBO_TRX // REPEATABLE-READ for consistency
111  ],
112  [ // emulated slave
113  'host' => $wgDBserver,
114  'dbname' => $wgDBname,
115  'user' => $wgDBuser,
116  'password' => $wgDBpassword,
117  'type' => $wgDBtype,
118  'dbDirectory' => $wgSQLiteDataDir,
119  'load' => 100,
120  'flags' => DBO_TRX // REPEATABLE-READ for consistency
121  ]
122  ];
123 
124  $factory = new LBFactorySimple( [
125  'servers' => $servers,
126  'loadMonitorClass' => 'LoadMonitorNull'
127  ] );
128  $lb = $factory->getMainLB();
129 
130  $dbw = $lb->getConnection( DB_MASTER );
131  $this->assertTrue( $dbw->getLBInfo( 'master' ), 'master shows as master' );
132  $this->assertEquals(
133  ( $wgDBserver != '' ) ? $wgDBserver : 'localhost',
134  $dbw->getLBInfo( 'clusterMasterHost' ),
135  'cluster master set' );
136 
137  $dbr = $lb->getConnection( DB_REPLICA );
138  $this->assertTrue( $dbr->getLBInfo( 'replica' ), 'slave shows as slave' );
139  $this->assertEquals(
140  ( $wgDBserver != '' ) ? $wgDBserver : 'localhost',
141  $dbr->getLBInfo( 'clusterMasterHost' ),
142  'cluster master set' );
143 
144  $factory->shutdown();
145  $lb->closeAll();
146  }
147 
148  public function testLBFactoryMulti() {
150 
151  $factory = new LBFactoryMulti( [
152  'sectionsByDB' => [],
153  'sectionLoads' => [
154  'DEFAULT' => [
155  'test-db1' => 0,
156  'test-db2' => 100,
157  ],
158  ],
159  'serverTemplate' => [
160  'dbname' => $wgDBname,
161  'user' => $wgDBuser,
162  'password' => $wgDBpassword,
163  'type' => $wgDBtype,
164  'dbDirectory' => $wgSQLiteDataDir,
165  'flags' => DBO_DEFAULT
166  ],
167  'hostsByName' => [
168  'test-db1' => $wgDBserver,
169  'test-db2' => $wgDBserver
170  ],
171  'loadMonitorClass' => 'LoadMonitorNull'
172  ] );
173  $lb = $factory->getMainLB();
174 
175  $dbw = $lb->getConnection( DB_MASTER );
176  $this->assertTrue( $dbw->getLBInfo( 'master' ), 'master shows as master' );
177 
178  $dbr = $lb->getConnection( DB_REPLICA );
179  $this->assertTrue( $dbr->getLBInfo( 'replica' ), 'slave shows as slave' );
180 
181  $factory->shutdown();
182  $lb->closeAll();
183  }
184 
185  public function testChronologyProtector() {
186  // (a) First HTTP request
187  $mPos = new MySQLMasterPos( 'db1034-bin.000976', '843431247' );
188 
189  $now = microtime( true );
190  $mockDB = $this->getMockBuilder( 'DatabaseMysqli' )
191  ->disableOriginalConstructor()
192  ->getMock();
193  $mockDB->method( 'writesOrCallbacksPending' )->willReturn( true );
194  $mockDB->method( 'lastDoneWrites' )->willReturn( $now );
195  $mockDB->method( 'getMasterPos' )->willReturn( $mPos );
196 
197  $lb = $this->getMockBuilder( 'LoadBalancer' )
198  ->disableOriginalConstructor()
199  ->getMock();
200  $lb->method( 'getConnection' )->willReturn( $mockDB );
201  $lb->method( 'getServerCount' )->willReturn( 2 );
202  $lb->method( 'parentInfo' )->willReturn( [ 'id' => "main-DEFAULT" ] );
203  $lb->method( 'getAnyOpenConnection' )->willReturn( $mockDB );
204  $lb->method( 'hasOrMadeRecentMasterChanges' )->will( $this->returnCallback(
205  function () use ( $mockDB ) {
206  $p = 0;
207  $p |= call_user_func( [ $mockDB, 'writesOrCallbacksPending' ] );
208  $p |= call_user_func( [ $mockDB, 'lastDoneWrites' ] );
209 
210  return (bool)$p;
211  }
212  ) );
213  $lb->method( 'getMasterPos' )->willReturn( $mPos );
214 
215  $bag = new HashBagOStuff();
216  $cp = new ChronologyProtector(
217  $bag,
218  [
219  'ip' => '127.0.0.1',
220  'agent' => "Totally-Not-FireFox"
221  ]
222  );
223 
224  $mockDB->expects( $this->exactly( 2 ) )->method( 'writesOrCallbacksPending' );
225  $mockDB->expects( $this->exactly( 2 ) )->method( 'lastDoneWrites' );
226 
227  // Nothing to wait for
228  $cp->initLB( $lb );
229  // Record in stash
230  $cp->shutdownLB( $lb );
231  $cp->shutdown();
232 
233  // (b) Second HTTP request
234  $cp = new ChronologyProtector(
235  $bag,
236  [
237  'ip' => '127.0.0.1',
238  'agent' => "Totally-Not-FireFox"
239  ]
240  );
241 
242  $lb->expects( $this->once() )
243  ->method( 'waitFor' )->with( $this->equalTo( $mPos ) );
244 
245  // Wait
246  $cp->initLB( $lb );
247  // Record in stash
248  $cp->shutdownLB( $lb );
249  $cp->shutdown();
250  }
251 
252  private function newLBFactoryMulti( array $baseOverride = [], array $serverOverride = [] ) {
254 
255  return new LBFactoryMulti( $baseOverride + [
256  'sectionsByDB' => [],
257  'sectionLoads' => [
258  'DEFAULT' => [
259  'test-db1' => 1,
260  ],
261  ],
262  'serverTemplate' => $serverOverride + [
263  'dbname' => $wgDBname,
264  'user' => $wgDBuser,
265  'password' => $wgDBpassword,
266  'type' => $wgDBtype,
267  'dbDirectory' => $wgSQLiteDataDir,
268  'flags' => DBO_DEFAULT
269  ],
270  'hostsByName' => [
271  'test-db1' => $wgDBserver,
272  ],
273  'loadMonitorClass' => 'LoadMonitorNull',
274  'localDomain' => wfWikiID()
275  ] );
276  }
277 
278  public function testNiceDomains() {
280 
281  if ( $wgDBtype === 'sqlite' ) {
282  $tmpDir = $this->getNewTempDirectory();
283  $dbPath = "$tmpDir/unit_test_db.sqlite";
284  file_put_contents( $dbPath, '' );
285  $tempFsFile = new TempFSFile( $dbPath );
286  $tempFsFile->autocollect();
287  } else {
288  $dbPath = null;
289  }
290 
291  $factory = $this->newLBFactoryMulti(
292  [],
293  [ 'dbFilePath' => $dbPath ]
294  );
295  $lb = $factory->getMainLB();
296 
297  if ( $wgDBtype !== 'sqlite' ) {
298  $db = $lb->getConnectionRef( DB_MASTER );
299  $this->assertEquals(
300  $wgDBname,
301  $db->getDomainID()
302  );
303  unset( $db );
304  }
305 
307  $db = $lb->getConnection( DB_MASTER, [], '' );
308  $lb->reuseConnection( $db ); // don't care
309 
310  $this->assertEquals(
311  '',
312  $db->getDomainID()
313  );
314 
315  $this->assertEquals(
316  $this->quoteTable( $db, 'page' ),
317  $db->tableName( 'page' ),
318  "Correct full table name"
319  );
320 
321  $this->assertEquals(
322  $this->quoteTable( $db, $wgDBname ) . '.' . $this->quoteTable( $db, 'page' ),
323  $db->tableName( "$wgDBname.page" ),
324  "Correct full table name"
325  );
326 
327  $this->assertEquals(
328  $this->quoteTable( $db, 'nice_db' ) . '.' . $this->quoteTable( $db, 'page' ),
329  $db->tableName( 'nice_db.page' ),
330  "Correct full table name"
331  );
332 
333  $factory->setDomainPrefix( 'my_' );
334  $this->assertEquals(
335  '',
336  $db->getDomainID()
337  );
338  $this->assertEquals(
339  $this->quoteTable( $db, 'my_page' ),
340  $db->tableName( 'page' ),
341  "Correct full table name"
342  );
343  $this->assertEquals(
344  $this->quoteTable( $db, 'other_nice_db' ) . '.' . $this->quoteTable( $db, 'page' ),
345  $db->tableName( 'other_nice_db.page' ),
346  "Correct full table name"
347  );
348 
349  $factory->closeAll();
350  $factory->destroy();
351  }
352 
353  public function testTrickyDomain() {
355 
356  if ( $wgDBtype === 'sqlite' ) {
357  $tmpDir = $this->getNewTempDirectory();
358  $dbPath = "$tmpDir/unit_test_db.sqlite";
359  file_put_contents( $dbPath, '' );
360  $tempFsFile = new TempFSFile( $dbPath );
361  $tempFsFile->autocollect();
362  } else {
363  $dbPath = null;
364  }
365 
366  $dbname = 'unittest-domain';
367  $factory = $this->newLBFactoryMulti(
368  [ 'localDomain' => $dbname ],
369  [ 'dbname' => $dbname, 'dbFilePath' => $dbPath ]
370  );
371  $lb = $factory->getMainLB();
373  $db = $lb->getConnection( DB_MASTER, [], '' );
374  $lb->reuseConnection( $db ); // don't care
375 
376  $this->assertEquals(
377  '',
378  $db->getDomainID()
379  );
380 
381  $this->assertEquals(
382  $this->quoteTable( $db, 'page' ),
383  $db->tableName( 'page' ),
384  "Correct full table name"
385  );
386 
387  $this->assertEquals(
388  $this->quoteTable( $db, $dbname ) . '.' . $this->quoteTable( $db, 'page' ),
389  $db->tableName( "$dbname.page" ),
390  "Correct full table name"
391  );
392 
393  $this->assertEquals(
394  $this->quoteTable( $db, 'nice_db' ) . '.' . $this->quoteTable( $db, 'page' ),
395  $db->tableName( 'nice_db.page' ),
396  "Correct full table name"
397  );
398 
399  $factory->setDomainPrefix( 'my_' );
400 
401  $this->assertEquals(
402  $this->quoteTable( $db, 'my_page' ),
403  $db->tableName( 'page' ),
404  "Correct full table name"
405  );
406  $this->assertEquals(
407  $this->quoteTable( $db, 'other_nice_db' ) . '.' . $this->quoteTable( $db, 'page' ),
408  $db->tableName( 'other_nice_db.page' ),
409  "Correct full table name"
410  );
411 
412  $this->assertEquals(
413  $this->quoteTable( $db, 'garbage-db' ) . '.' . $this->quoteTable( $db, 'page' ),
414  $db->tableName( 'garbage-db.page' ),
415  "Correct full table name"
416  );
417 
418  if ( $db->databasesAreIndependent() ) {
419  try {
420  $e = null;
421  $db->selectDB( 'garbage-db' );
422  } catch ( \Wikimedia\Rdbms\DBConnectionError $e ) {
423  // expected
424  }
425  $this->assertInstanceOf( '\Wikimedia\Rdbms\DBConnectionError', $e );
426  $this->assertFalse( $db->isOpen() );
427  } else {
428  \MediaWiki\suppressWarnings();
429  $this->assertFalse( $db->selectDB( 'garbage-db' ) );
430  \MediaWiki\restoreWarnings();
431  }
432 
433  $factory->closeAll();
434  $factory->destroy();
435  }
436 
437  private function quoteTable( Database $db, $table ) {
438  if ( $db->getType() === 'sqlite' ) {
439  return $table;
440  } else {
441  return $db->addIdentifierQuotes( $table );
442  }
443  }
444 }
$wgDBserver
$wgDBserver
Database host name or IP address.
Definition: DefaultSettings.php:1772
HashBagOStuff
Simple store for keeping values in an associative array for the current process.
Definition: HashBagOStuff.php:31
$wgDBtype
$wgDBtype
Database type.
Definition: DefaultSettings.php:1797
$result
The index of the header message $result[1]=The index of the body text message $result[2 through n]=Parameters passed to body text message. Please note the header message cannot receive/use parameters. 'ImportHandleLogItemXMLTag':When parsing a XML tag in a log item. Return false to stop further processing of the tag $reader:XMLReader object $logInfo:Array of information 'ImportHandlePageXMLTag':When parsing a XML tag in a page. Return false to stop further processing of the tag $reader:XMLReader object & $pageInfo:Array of information 'ImportHandleRevisionXMLTag':When parsing a XML tag in a page revision. Return false to stop further processing of the tag $reader:XMLReader object $pageInfo:Array of page information $revisionInfo:Array of revision information 'ImportHandleToplevelXMLTag':When parsing a top level XML tag. Return false to stop further processing of the tag $reader:XMLReader object 'ImportHandleUploadXMLTag':When parsing a XML tag in a file upload. Return false to stop further processing of the tag $reader:XMLReader object $revisionInfo:Array of information 'ImportLogInterwikiLink':Hook to change the interwiki link used in log entries and edit summaries for transwiki imports. & $fullInterwikiPrefix:Interwiki prefix, may contain colons. & $pageTitle:String that contains page title. 'ImportSources':Called when reading from the $wgImportSources configuration variable. Can be used to lazy-load the import sources list. & $importSources:The value of $wgImportSources. Modify as necessary. See the comment in DefaultSettings.php for the detail of how to structure this array. 'InfoAction':When building information to display on the action=info page. $context:IContextSource object & $pageInfo:Array of information 'InitializeArticleMaybeRedirect':MediaWiki check to see if title is a redirect. & $title:Title object for the current page & $request:WebRequest & $ignoreRedirect:boolean to skip redirect check & $target:Title/string of redirect target & $article:Article object 'InternalParseBeforeLinks':during Parser 's internalParse method before links but after nowiki/noinclude/includeonly/onlyinclude and other processings. & $parser:Parser object & $text:string containing partially parsed text & $stripState:Parser 's internal StripState object 'InternalParseBeforeSanitize':during Parser 's internalParse method just before the parser removes unwanted/dangerous HTML tags and after nowiki/noinclude/includeonly/onlyinclude and other processings. Ideal for syntax-extensions after template/parser function execution which respect nowiki and HTML-comments. & $parser:Parser object & $text:string containing partially parsed text & $stripState:Parser 's internal StripState object 'InterwikiLoadPrefix':When resolving if a given prefix is an interwiki or not. Return true without providing an interwiki to continue interwiki search. $prefix:interwiki prefix we are looking for. & $iwData:output array describing the interwiki with keys iw_url, iw_local, iw_trans and optionally iw_api and iw_wikiid. 'InvalidateEmailComplete':Called after a user 's email has been invalidated successfully. $user:user(object) whose email is being invalidated 'IRCLineURL':When constructing the URL to use in an IRC notification. Callee may modify $url and $query, URL will be constructed as $url . $query & $url:URL to index.php & $query:Query string $rc:RecentChange object that triggered url generation 'IsFileCacheable':Override the result of Article::isFileCacheable()(if true) & $article:article(object) being checked 'IsTrustedProxy':Override the result of IP::isTrustedProxy() & $ip:IP being check & $result:Change this value to override the result of IP::isTrustedProxy() 'IsUploadAllowedFromUrl':Override the result of UploadFromUrl::isAllowedUrl() $url:URL used to upload from & $allowed:Boolean indicating if uploading is allowed for given URL 'isValidEmailAddr':Override the result of Sanitizer::validateEmail(), for instance to return false if the domain name doesn 't match your organization. $addr:The e-mail address entered by the user & $result:Set this and return false to override the internal checks 'isValidPassword':Override the result of User::isValidPassword() $password:The password entered by the user & $result:Set this and return false to override the internal checks $user:User the password is being validated for 'Language::getMessagesFileName':$code:The language code or the language we 're looking for a messages file for & $file:The messages file path, you can override this to change the location. 'LanguageGetMagic':DEPRECATED! Use $magicWords in a file listed in $wgExtensionMessagesFiles instead. Use this to define synonyms of magic words depending of the language & $magicExtensions:associative array of magic words synonyms $lang:language code(string) 'LanguageGetNamespaces':Provide custom ordering for namespaces or remove namespaces. Do not use this hook to add namespaces. Use CanonicalNamespaces for that. & $namespaces:Array of namespaces indexed by their numbers 'LanguageGetSpecialPageAliases':DEPRECATED! Use $specialPageAliases in a file listed in $wgExtensionMessagesFiles instead. Use to define aliases of special pages names depending of the language & $specialPageAliases:associative array of magic words synonyms $lang:language code(string) 'LanguageGetTranslatedLanguageNames':Provide translated language names. & $names:array of language code=> language name $code:language of the preferred translations 'LanguageLinks':Manipulate a page 's language links. This is called in various places to allow extensions to define the effective language links for a page. $title:The page 's Title. & $links:Array with elements of the form "language:title" in the order that they will be output. & $linkFlags:Associative array mapping prefixed links to arrays of flags. Currently unused, but planned to provide support for marking individual language links in the UI, e.g. for featured articles. 'LanguageSelector':Hook to change the language selector available on a page. $out:The output page. $cssClassName:CSS class name of the language selector. 'LinkBegin':DEPRECATED! Use HtmlPageLinkRendererBegin instead. Used when generating internal and interwiki links in Linker::link(), before processing starts. Return false to skip default processing and return $ret. See documentation for Linker::link() for details on the expected meanings of parameters. $skin:the Skin object $target:the Title that the link is pointing to & $html:the contents that the< a > tag should have(raw HTML) $result
Definition: hooks.txt:1963
use
as see the revision history and available at free of to any person obtaining a copy of this software and associated documentation to deal in the Software without including without limitation the rights to use
Definition: MIT-LICENSE.txt:10
LBFactoryTest
Definition: LBFactoryTest.php:32
$wgDBpassword
$wgDBpassword
Database user's password.
Definition: DefaultSettings.php:1792
DBO_TRX
const DBO_TRX
Definition: defines.php:12
php
injection txt This is an overview of how MediaWiki makes use of dependency injection The design described here grew from the discussion of RFC T384 The term dependency this means that anything an object needs to operate should be injected from the the object itself should only know narrow no concrete implementation of the logic it relies on The requirement to inject everything typically results in an architecture that based on two main types of and essentially stateless service objects that use other service objects to operate on the value objects As of the beginning MediaWiki is only starting to use the DI approach Much of the code still relies on global state or direct resulting in a highly cyclical dependency which acts as the top level factory for services in MediaWiki which can be used to gain access to default instances of various services MediaWikiServices however also allows new services to be defined and default services to be redefined Services are defined or redefined by providing a callback the instantiator that will return a new instance of the service When it will create an instance of MediaWikiServices and populate it with the services defined in the files listed by thereby bootstrapping the DI framework Per $wgServiceWiringFiles lists includes ServiceWiring php
Definition: injection.txt:35
LBFactoryTest\quoteTable
quoteTable(Database $db, $table)
Definition: LBFactoryTest.php:437
$wgSQLiteDataDir
$wgSQLiteDataDir
To override default SQLite data directory ($docroot/../data)
Definition: DefaultSettings.php:1872
$wgDBname
controlled by $wgMainCacheType controlled by $wgParserCacheType controlled by $wgMessageCacheType If you set CACHE_NONE to one of the three control default value for MediaWiki still create a but requests to it are no ops and we always fall through to the database If the cache daemon can t be it should also disable itself fairly smoothly By $wgMemc is used but when it is $parserMemc or $messageMemc this is mentioned $wgDBname
Definition: memcached.txt:96
Wikimedia\Rdbms\LBFactorySimple
A simple single-master LBFactory that gets its configuration from the b/c globals.
Definition: LBFactorySimple.php:31
MediaWikiTestCase
Definition: MediaWikiTestCase.php:15
LBFactoryTest\testLBFactorySimpleServer
testLBFactorySimpleServer()
Definition: LBFactoryTest.php:69
MediaWikiTestCase\hideDeprecated
hideDeprecated( $function)
Don't throw a warning if $function is deprecated and called later.
Definition: MediaWikiTestCase.php:1467
Wikimedia\Rdbms\MySQLMasterPos
DBMasterPos class for MySQL/MariaDB.
Definition: MySQLMasterPos.php:15
MWLBFactory\getLBFactoryClass
static getLBFactoryClass(array $config)
Returns the LBFactory class to use and the load balancer configuration.
Definition: MWLBFactory.php:170
global
when a variable name is used in a it is silently declared as a new masking the global
Definition: design.txt:93
DB_REPLICA
const DB_REPLICA
Definition: defines.php:25
DB_MASTER
const DB_MASTER
Definition: defines.php:26
wfWikiID
wfWikiID()
Get an ASCII string identifying this wiki This is used as a prefix in memcached keys.
Definition: GlobalFunctions.php:2807
$e
div flags Integer display flags(NO_ACTION_LINK, NO_EXTRA_USER_LINKS) 'LogException' returning false will NOT prevent logging $e
Definition: hooks.txt:2141
LBFactoryTest\testLBFactorySimpleServers
testLBFactorySimpleServers()
Definition: LBFactoryTest.php:98
TempFSFile
This class is used to hold the location and do limited manipulation of files stored temporarily (this...
Definition: TempFSFile.php:30
Wikimedia\Rdbms\LBFactoryMulti
A multi-database, multi-master factory for Wikimedia and similar installations.
Definition: LBFactoryMulti.php:34
LBFactoryTest\newLBFactoryMulti
newLBFactoryMulti(array $baseOverride=[], array $serverOverride=[])
Definition: LBFactoryTest.php:252
$dbr
if(! $regexes) $dbr
Definition: cleanup.php:94
Wikimedia\Rdbms\ChronologyProtector
Class for ensuring a consistent ordering of events as seen by the user, despite replication.
Definition: ChronologyProtector.php:36
LBFactoryTest\testChronologyProtector
testChronologyProtector()
Definition: LBFactoryTest.php:185
Wikimedia
LBFactoryTest\testGetLBFactoryClass
testGetLBFactoryClass( $expected, $deprecated)
getLBFactoryClassProvider
Definition: LBFactoryTest.php:37
LBFactoryTest\testNiceDomains
testNiceDomains()
Definition: LBFactoryTest.php:278
class
you have access to all of the normal MediaWiki so you can get a DB use the etc For full docs on the Maintenance class
Definition: maintenance.txt:52
$wgDBuser
$wgDBuser
Database username.
Definition: DefaultSettings.php:1787
LBFactoryTest\testLBFactoryMulti
testLBFactoryMulti()
Definition: LBFactoryTest.php:148
DBO_DEFAULT
const DBO_DEFAULT
Definition: defines.php:13
LBFactoryTest\testTrickyDomain
testTrickyDomain()
Definition: LBFactoryTest.php:353
MediaWikiTestCase\$db
Database $db
Primary database.
Definition: MediaWikiTestCase.php:52
array
the array() calling protocol came about after MediaWiki 1.4rc1.
LBFactoryTest\getLBFactoryClassProvider
getLBFactoryClassProvider()
Definition: LBFactoryTest.php:57
MediaWikiTestCase\getNewTempDirectory
getNewTempDirectory()
obtains a new temporary directory
Definition: MediaWikiTestCase.php:474