summaryrefslogtreecommitdiff
path: root/tests/phpunit/languages/LanguageCuTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/phpunit/languages/LanguageCuTest.php')
-rw-r--r--tests/phpunit/languages/LanguageCuTest.php41
1 files changed, 21 insertions, 20 deletions
diff --git a/tests/phpunit/languages/LanguageCuTest.php b/tests/phpunit/languages/LanguageCuTest.php
index f8186d7b..07193172 100644
--- a/tests/phpunit/languages/LanguageCuTest.php
+++ b/tests/phpunit/languages/LanguageCuTest.php
@@ -6,36 +6,37 @@
*/
/** Tests for MediaWiki languages/LanguageCu.php */
-class LanguageCuTest extends MediaWikiTestCase {
- private $lang;
-
- function setUp() {
- $this->lang = Language::factory( 'cu' );
- }
- function tearDown() {
- unset( $this->lang );
+class LanguageCuTest extends LanguageClassesTestCase {
+ /**
+ * @dataProvider providePlural
+ * @covers Language::convertPlural
+ */
+ public function testPlural( $result, $value ) {
+ $forms = array( 'one', 'two', 'few', 'other' );
+ $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
}
- /** @dataProvider providerPlural */
- function testPlural( $result, $value ) {
- $forms = array( 'one', 'few', 'many', 'other' );
- $this->assertEquals( $result, $this->lang->convertPlural( $value, $forms ) );
+ /**
+ * @dataProvider providePlural
+ * @covers Language::getPluralRuleType
+ */
+ public function testGetPluralRuleType( $result, $value ) {
+ $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) );
}
- function providerPlural() {
- return array (
+ public static function providePlural() {
+ return array(
array( 'other', 0 ),
array( 'one', 1 ),
- array( 'few', 2 ),
- array( 'many', 3 ),
- array( 'many', 4 ),
+ array( 'two', 2 ),
+ array( 'few', 3 ),
+ array( 'few', 4 ),
array( 'other', 5 ),
array( 'one', 11 ),
array( 'other', 20 ),
- array( 'few', 22 ),
- array( 'many', 223 ),
+ array( 'two', 22 ),
+ array( 'few', 223 ),
array( 'other', 200 ),
);
}
-
}