Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F4111537
MessageFormatterFactoryTest.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
914 B
Referenced Files
None
Subscribers
None
MessageFormatterFactoryTest.php
View Options
<?php
use
MediaWiki\Message\Message
;
use
MediaWiki\Message\MessageFormatterFactory
;
/**
* @covers \MediaWiki\Message\MessageFormatterFactory
*/
class
MessageFormatterFactoryTest
extends
MediaWikiUnitTestCase
{
use
MediaWikiCoversValidator
;
public
static
function
provideGetTextFormatter
()
{
yield
[
'en'
,
null
];
yield
[
'en'
,
Message
::
FORMAT_TEXT
];
yield
[
'ru'
,
Message
::
FORMAT_PLAIN
];
}
/**
* @covers \MediaWiki\Message\MessageFormatterFactory::getTextFormatter
* @dataProvider provideGetTextFormatter
* @param string $lang
* @param string|null $format
*/
public
function
testGetTextFormatter
(
string
$lang
,
?
string
$format
=
null
)
{
if
(
$format
)
{
$factory
=
new
MessageFormatterFactory
(
$format
);
}
else
{
$factory
=
new
MessageFormatterFactory
();
}
$formatter
=
$factory
->
getTextFormatter
(
$lang
);
$this
->
assertSame
(
$lang
,
$formatter
->
getLangCode
()
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Tue, Aug 18, 22:23 (1 d, 15 h)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
54/44/5ad25016523e361d2a2007d7db4b
Default Alt Text
MessageFormatterFactoryTest.php (914 B)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment