From 91e194556c52d2f354344f930419eef2dd6267f0 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Wed, 4 Sep 2013 05:51:59 +0200 Subject: Update to MediaWiki 1.21.2 --- tests/phpunit/languages/LanguageRuTest.php | 78 ++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 tests/phpunit/languages/LanguageRuTest.php (limited to 'tests/phpunit/languages/LanguageRuTest.php') diff --git a/tests/phpunit/languages/LanguageRuTest.php b/tests/phpunit/languages/LanguageRuTest.php new file mode 100644 index 00000000..0792f75b --- /dev/null +++ b/tests/phpunit/languages/LanguageRuTest.php @@ -0,0 +1,78 @@ +assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); + } + + function providePluralFourForms() { + return array( + array( 'one', 1 ), + array( 'many', 11 ), + array( 'one', 91 ), + array( 'one', 121 ), + array( 'few', 2 ), + array( 'few', 3 ), + array( 'few', 4 ), + array( 'few', 334 ), + array( 'many', 5 ), + array( 'many', 15 ), + array( 'many', 120 ), + ); + } + + /** @dataProvider providePluralTwoForms */ + function testPluralTwoForms( $result, $value ) { + $forms = array( 'one', 'several' ); + $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); + } + + function providePluralTwoForms() { + return array( + array( 'one', 1 ), + array( 'several', 11 ), + array( 'several', 91 ), + array( 'several', 121 ), + ); + } + + /** @dataProvider providerGrammar */ + function testGrammar( $result, $word, $case ) { + $this->assertEquals( $result, $this->getLang()->convertGrammar( $word, $case ) ); + } + + function providerGrammar() { + return array( + array( + 'Википедии', + 'Википедия', + 'genitive', + ), + array( + 'Викитеки', + 'Викитека', + 'genitive', + ), + array( + 'Викитеке', + 'Викитека', + 'prepositional', + ), + array( + 'Викиданных', + 'Викиданные', + 'prepositional', + ), + ); + } +} -- cgit v1.2.2