Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F4110616
LanguageLtTest.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
LanguageLtTest.php
View Options
<?php
/**
* @author Santhosh Thottingal
* @copyright Copyright © 2012, Santhosh Thottingal
* @file
*/
/**
* @group Language
*/
class
LanguageLtTest
extends
LanguageClassesTestCase
{
/**
* @dataProvider providePlural
* @covers \MediaWiki\Language\Language::convertPlural
*/
public
function
testPlural
(
$result
,
$value
)
{
$forms
=
[
'one'
,
'few'
,
'other'
];
$this
->
assertEquals
(
$result
,
$this
->
getLang
()->
convertPlural
(
$value
,
$forms
)
);
}
/**
* @dataProvider providePlural
* @covers \MediaWiki\Language\Language::getPluralRuleType
*/
public
function
testGetPluralRuleType
(
$result
,
$value
)
{
$this
->
assertEquals
(
$result
,
$this
->
getLang
()->
getPluralRuleType
(
$value
)
);
}
public
static
function
providePlural
()
{
return
[
[
'other'
,
0
],
[
'one'
,
1
],
[
'few'
,
2
],
[
'few'
,
9
],
[
'other'
,
10
],
[
'other'
,
11
],
[
'other'
,
20
],
[
'one'
,
21
],
[
'few'
,
32
],
[
'one'
,
41
],
[
'one'
,
40001
],
];
}
/**
* @dataProvider providePluralTwoForms
* @covers \MediaWiki\Language\Language::convertPlural
*/
public
function
testOneFewPlural
(
$result
,
$value
)
{
$forms
=
[
'one'
,
'other'
];
// This fails for 21, but not sure why.
$this
->
assertEquals
(
$result
,
$this
->
getLang
()->
convertPlural
(
$value
,
$forms
)
);
}
public
static
function
providePluralTwoForms
()
{
return
[
[
'one'
,
1
],
[
'other'
,
2
],
[
'other'
,
15
],
[
'other'
,
20
],
[
'one'
,
21
],
[
'other'
,
22
],
];
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Tue, Aug 18, 21:55 (1 d, 8 h)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
6e/b3/d36215e6cd48b6ba86df57f7692d
Default Alt Text
LanguageLtTest.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment