summaryrefslogtreecommitdiff
path: root/tests/phpunit/languages/LanguageLtTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/phpunit/languages/LanguageLtTest.php')
-rw-r--r--tests/phpunit/languages/LanguageLtTest.php38
1 files changed, 28 insertions, 10 deletions
diff --git a/tests/phpunit/languages/LanguageLtTest.php b/tests/phpunit/languages/LanguageLtTest.php
index 9d6428b8..30642f62 100644
--- a/tests/phpunit/languages/LanguageLtTest.php
+++ b/tests/phpunit/languages/LanguageLtTest.php
@@ -7,20 +7,24 @@
/** Tests for MediaWiki languages/LanguageLt.php */
class LanguageLtTest extends LanguageClassesTestCase {
-
- /** @dataProvider provideOneFewOtherCases */
- function testOneFewOtherPlural( $result, $value ) {
+ /**
+ * @dataProvider providePlural
+ * @covers Language::convertPlural
+ */
+ public function testPlural( $result, $value ) {
$forms = array( 'one', 'few', 'other' );
$this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
}
- /** @dataProvider provideOneFewCases */
- function testOneFewPlural( $result, $value ) {
- $forms = array( 'one', 'few' );
- $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
+ /**
+ * @dataProvider providePlural
+ * @covers Language::getPluralRuleType
+ */
+ public function testGetPluralRuleType( $result, $value ) {
+ $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) );
}
- function provideOneFewOtherCases() {
+ public static function providePlural() {
return array(
array( 'other', 0 ),
array( 'one', 1 ),
@@ -36,10 +40,24 @@ class LanguageLtTest extends LanguageClassesTestCase {
);
}
- function provideOneFewCases() {
+ /**
+ * @dataProvider providePluralTwoForms
+ * @covers Language::convertPlural
+ */
+ public function testOneFewPlural( $result, $value ) {
+ $forms = array( 'one', 'other' );
+ // This fails for 21, but not sure why.
+ $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
+ }
+
+ public static function providePluralTwoForms() {
return array(
array( 'one', 1 ),
- array( 'few', 15 ),
+ array( 'other', 2 ),
+ array( 'other', 15 ),
+ array( 'other', 20 ),
+ array( 'one', 21 ),
+ array( 'other', 22 ),
);
}
}