Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F1425765
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
Sat, May 16, 11:58 (19 h, 53 m)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
1b/17/ec39397f92931e0a8083bc84b534
Default Alt Text
LanguageLtTest.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment