Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F4108854
ConfigWrapperTest.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
ConfigWrapperTest.php
View Options
<?php
namespace
Babel\Tests\Unit
;
use
MediaWiki\Babel\Config\ConfigWrapper
;
use
MediaWiki\Extension\CommunityConfiguration\Access\MediaWikiConfigRouter
;
use
MediaWikiUnitTestCase
;
/**
* @covers \MediaWiki\Babel\Config\ConfigWrapper
*/
class
ConfigWrapperTest
extends
MediaWikiUnitTestCase
{
public
function
testReturnsArray
()
{
$configReaderMock
=
$this
->
createNoOpMock
(
MediaWikiConfigRouter
::
class
,
[
'get'
]
);
$configReaderMock
->
expects
(
$this
->
once
()
)
->
method
(
'get'
)
->
with
(
'BabelConfig'
)
->
willReturn
(
(
object
)[
'Number'
=>
42
]
);
$wrapper
=
new
ConfigWrapper
(
$configReaderMock
);
$this
->
assertSame
(
[
'Number'
=>
42
],
$wrapper
->
get
(
'BabelConfig'
)
);
}
public
function
testRelaysHas
()
{
$configReaderMock
=
$this
->
createNoOpMock
(
MediaWikiConfigRouter
::
class
,
[
'has'
]
);
$configReaderMock
->
expects
(
$this
->
once
()
)
->
method
(
'has'
)
->
with
(
'BabelConfig'
)
->
willReturn
(
false
);
$wrapper
=
new
ConfigWrapper
(
$configReaderMock
);
$this
->
assertFalse
(
$wrapper
->
has
(
'BabelConfig'
)
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Tue, Aug 18, 20:45 (2 w, 2 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
13/75/c3e804e43e4165019fa54e88a442
Default Alt Text
ConfigWrapperTest.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment