summaryrefslogtreecommitdiff
path: root/tests/phpunit/languages/LanguageRuTest.php
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2014-01-14 19:24:18 +0100
committerPierre Schmitz <pierre@archlinux.de>2014-01-14 19:24:18 +0100
commit224b22a051051f6c2e494c3a2fb4adb42898e2d1 (patch)
tree85a41a4cf8533bf740ec4c8d3affce88414daa56 /tests/phpunit/languages/LanguageRuTest.php
parent9937b8e6d6a8b4517c04c143daaf9ebd42ce8ba0 (diff)
Update to MediaWiki 1.22.1
Diffstat (limited to 'tests/phpunit/languages/LanguageRuTest.php')
-rw-r--r--tests/phpunit/languages/LanguageRuTest.php23
1 files changed, 17 insertions, 6 deletions
diff --git a/tests/phpunit/languages/LanguageRuTest.php b/tests/phpunit/languages/LanguageRuTest.php
index e938be79..e17c7085 100644
--- a/tests/phpunit/languages/LanguageRuTest.php
+++ b/tests/phpunit/languages/LanguageRuTest.php
@@ -13,11 +13,22 @@ class LanguageRuTest extends LanguageClassesTestCase {
* @covers Language::convertPlural
*/
public function testPlural( $result, $value ) {
- $forms = array( 'one', 'few', 'many', 'other' );
+ $forms = array( 'one', 'many', 'other' );
$this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
}
/**
+ * Test explicit plural forms - n=FormN forms
+ * @covers Language::convertPlural
+ */
+ public function testExplicitPlural() {
+ $forms = array( 'one','many', 'other', '12=dozen' );
+ $this->assertEquals( 'dozen', $this->getLang()->convertPlural( 12, $forms ) );
+ $forms = array( 'one', 'many', '100=hundred', 'other', '12=dozen' );
+ $this->assertEquals( 'hundred', $this->getLang()->convertPlural( 100, $forms ) );
+ }
+
+ /**
* @dataProvider providePlural
* @covers Language::getPluralRuleType
*/
@@ -31,10 +42,10 @@ class LanguageRuTest extends LanguageClassesTestCase {
array( 'many', 11 ),
array( 'one', 91 ),
array( 'one', 121 ),
- array( 'few', 2 ),
- array( 'few', 3 ),
- array( 'few', 4 ),
- array( 'few', 334 ),
+ array( 'other', 2 ),
+ array( 'other', 3 ),
+ array( 'other', 4 ),
+ array( 'other', 334 ),
array( 'many', 5 ),
array( 'many', 15 ),
array( 'many', 120 ),
@@ -46,7 +57,7 @@ class LanguageRuTest extends LanguageClassesTestCase {
* @covers Language::convertPlural
*/
public function testPluralTwoForms( $result, $value ) {
- $forms = array( 'one', 'other' );
+ $forms = array( '1=one', 'other' );
$this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
}