X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=tests%2Fphpunit%2Flanguages%2FLanguageRuTest.php;h=0792f75b930752333ca1ef69ed6520977c6b3380;hb=88066420004931111290ed42ce9ee8f6e3a76c90;hp=f545a1364854efc7d1f93e672e41ea867e5e9222;hpb=629df62ac2f8cc8639d9a470e2e6495b1aaf8f1b;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/phpunit/languages/LanguageRuTest.php b/tests/phpunit/languages/LanguageRuTest.php index f545a13648..0792f75b93 100644 --- a/tests/phpunit/languages/LanguageRuTest.php +++ b/tests/phpunit/languages/LanguageRuTest.php @@ -16,7 +16,7 @@ class LanguageRuTest extends LanguageClassesTestCase { } function providePluralFourForms() { - return array ( + return array( array( 'one', 1 ), array( 'many', 11 ), array( 'one', 91 ), @@ -30,17 +30,49 @@ class LanguageRuTest extends LanguageClassesTestCase { array( 'many', 120 ), ); } + /** @dataProvider providePluralTwoForms */ function testPluralTwoForms( $result, $value ) { - $forms = array( 'one', 'several' ); + $forms = array( 'one', 'several' ); $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); } + function providePluralTwoForms() { - return array ( + 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', + ), + ); + } }