r110493 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r110492‎ | r110493 | r110494 >
Date:15:59, 1 February 2012
Author:amire80
Status:ok
Tags:core, i18nreview 
Comment:
Added tests for plural, same as Russian.
Modified paths:
  • /trunk/phase3/tests/phpunit/languages/LanguageSrTest.php (modified) (history)

Diff [purge]

Index: trunk/phase3/tests/phpunit/languages/LanguageSrTest.php
@@ -96,9 +96,43 @@
9797 $this->assertEquals( 'абцдšđžčć',
9898 $this->convertToLatin( 'абцдšđžčć' )
9999 );
 100+ }
100101
 102+ /** @dataProvider providePluralFourForms */
 103+ function testPluralFourForms( $result, $value ) {
 104+ $forms = array( 'one', 'few', 'many', 'other' );
 105+ $this->assertEquals( $result, $this->lang->convertPlural( $value, $forms ) );
101106 }
102107
 108+ function providePluralFourForms() {
 109+ return array (
 110+ array( 'one', 1 ),
 111+ array( 'many', 11 ),
 112+ array( 'one', 91 ),
 113+ array( 'one', 121 ),
 114+ array( 'few', 2 ),
 115+ array( 'few', 3 ),
 116+ array( 'few', 4 ),
 117+ array( 'few', 334 ),
 118+ array( 'many', 5 ),
 119+ array( 'many', 15 ),
 120+ array( 'many', 120 ),
 121+ );
 122+ }
 123+ /** @dataProvider providePluralTwoForms */
 124+ function testPluralTwoForms( $result, $value ) {
 125+ $forms = array( 'one', 'several' );
 126+ $this->assertEquals( $result, $this->lang->convertPlural( $value, $forms ) );
 127+ }
 128+ function providePluralTwoForms() {
 129+ return array (
 130+ array( 'one', 1 ),
 131+ array( 'several', 11 ),
 132+ array( 'several', 91 ),
 133+ array( 'several', 121 ),
 134+ );
 135+ }
 136+
103137 ##### HELPERS #####################################################
104138 /**
105139 *Wrapper to verify text stay the same after applying conversion

Status & tagging log