From: Amir E. Aharoni Date: Wed, 1 Feb 2012 15:59:26 +0000 (+0000) Subject: Added tests for plural, same as Russian. X-Git-Tag: 1.31.0-rc.0~24975 X-Git-Url: https://git.cyclocoop.org//%22?a=commitdiff_plain;h=5b7484cfe3a297da426d4d2198765b38791db256;p=lhc%2Fweb%2Fwiklou.git Added tests for plural, same as Russian. --- diff --git a/tests/phpunit/languages/LanguageSrTest.php b/tests/phpunit/languages/LanguageSrTest.php index e58c51638c..8cfdccde86 100644 --- a/tests/phpunit/languages/LanguageSrTest.php +++ b/tests/phpunit/languages/LanguageSrTest.php @@ -96,7 +96,41 @@ class LanguageSrTest extends MediaWikiTestCase { $this->assertEquals( 'абцдšđžčć', $this->convertToLatin( 'абцдšđžčć' ) ); + } + + /** @dataProvider providePluralFourForms */ + function testPluralFourForms( $result, $value ) { + $forms = array( 'one', 'few', 'many', 'other' ); + $this->assertEquals( $result, $this->lang->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->lang->convertPlural( $value, $forms ) ); + } + function providePluralTwoForms() { + return array ( + array( 'one', 1 ), + array( 'several', 11 ), + array( 'several', 91 ), + array( 'several', 121 ), + ); } ##### HELPERS #####################################################