Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F5987834
DbFactoryTest.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
DbFactoryTest.php
View Options
<?php
namespace
MediaWiki\Extension\Notifications\Test
;
use
MediaWiki\Extension\Notifications\DbFactory
;
use
MediaWikiIntegrationTestCase
;
use
ReflectionClass
;
use
Wikimedia\Rdbms\IDatabase
;
use
Wikimedia\Rdbms\ILoadBalancer
;
/**
* @covers \MediaWiki\Extension\Notifications\DbFactory
* @group Database
*/
class
DbFactoryTest
extends
MediaWikiIntegrationTestCase
{
public
function
testNewFromDefault
()
{
$db
=
DbFactory
::
newFromDefault
();
$this
->
assertInstanceOf
(
DbFactory
::
class
,
$db
);
return
$db
;
}
/**
* @depends testNewFromDefault
*/
public
function
testGetEchoDb
(
DbFactory
$db
)
{
$this
->
assertInstanceOf
(
IDatabase
::
class
,
$db
->
getEchoDb
(
DB_PRIMARY
)
);
$this
->
assertInstanceOf
(
IDatabase
::
class
,
$db
->
getEchoDb
(
DB_REPLICA
)
);
}
/**
* @depends testNewFromDefault
*/
public
function
testGetLB
(
DbFactory
$db
)
{
$reflection
=
new
ReflectionClass
(
DbFactory
::
class
);
$method
=
$reflection
->
getMethod
(
'getLB'
);
$method
->
setAccessible
(
true
);
$this
->
assertInstanceOf
(
ILoadBalancer
::
class
,
$method
->
invoke
(
$db
)
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sun, Oct 4, 00:35 (2 w, 6 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
67/55/96e9ec79caf845839c3c0df1aacc
Default Alt Text
DbFactoryTest.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment