Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F4119092
MediaWikiUnitTestCaseTest.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
MediaWikiUnitTestCaseTest.php
View Options
<?php
use
MediaWiki\Config\HashConfig
;
use
Wikimedia\ObjectCache\HashBagOStuff
;
use
Wikimedia\Services\NoSuchServiceException
;
/**
* Test functionality implemented in the MediaWikiUnitTestCase base class.
*
* @covers \MediaWikiUnitTestCase
*/
class
MediaWikiUnitTestCaseTest
extends
MediaWikiUnitTestCase
{
public
function
testServiceContainer
()
{
$config
=
new
HashConfig
();
$cache
=
new
HashBagOStuff
();
$this
->
setService
(
'MainConfig'
,
$config
);
$services
=
$this
->
getServiceContainer
();
$this
->
setService
(
'LocalServerObjectCache'
,
static
function
()
use
(
$cache
)
{
return
$cache
;
}
);
$this
->
assertSame
(
$config
,
$services
->
get
(
'MainConfig'
)
);
$this
->
assertSame
(
$config
,
$services
->
getService
(
'MainConfig'
)
);
$this
->
assertSame
(
$config
,
$services
->
getMainConfig
()
);
$this
->
assertSame
(
$cache
,
$services
->
get
(
'LocalServerObjectCache'
)
);
$this
->
assertSame
(
$cache
,
$services
->
getService
(
'LocalServerObjectCache'
)
);
$this
->
assertSame
(
$cache
,
$services
->
getLocalServerObjectCache
()
);
$this
->
expectException
(
NoSuchServiceException
::
class
);
$services
->
getMessageCache
();
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Wed, Aug 19, 03:09 (2 w, 1 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
74/0c/1c94103d70d077f1f90329d4abbe
Default Alt Text
MediaWikiUnitTestCaseTest.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment