MediaWiki  REL1_19
LanguageRuTest.php
Go to the documentation of this file.
00001 <?php
00010 class LanguageRuTest extends MediaWikiTestCase {
00011         private $lang;
00012 
00013         function setUp() {
00014                 $this->lang = Language::factory( 'ru' );
00015         }
00016         function tearDown() {
00017                 unset( $this->lang );
00018         }
00019 
00021         function testPluralFourForms( $result, $value ) {
00022                 $forms = array( 'one', 'few', 'many', 'other' );
00023                 $this->assertEquals( $result, $this->lang->convertPlural( $value, $forms ) );
00024         }
00025 
00026         function providePluralFourForms() {
00027                 return array (
00028                         array( 'one', 1 ),
00029                         array( 'many', 11 ),
00030                         array( 'one', 91 ),
00031                         array( 'one', 121 ),
00032                         array( 'few', 2 ),
00033                         array( 'few', 3 ),
00034                         array( 'few', 4 ),
00035                         array( 'few', 334 ),
00036                         array( 'many', 5 ),
00037                         array( 'many', 15 ),
00038                         array( 'many', 120 ),
00039                 );
00040         }
00042         function testPluralTwoForms( $result, $value ) {
00043                 $forms =  array( 'one', 'several' );
00044                 $this->assertEquals( $result, $this->lang->convertPlural( $value, $forms ) );
00045         }
00046         function providePluralTwoForms() {
00047                 return array (
00048                         array( 'one', 1 ),
00049                         array( 'several', 11 ),
00050                         array( 'several', 91 ),
00051                         array( 'several', 121 ),
00052                 );
00053         }
00054 }