MediaWiki  REL1_21
LanguageRuTest.php
Go to the documentation of this file.
00001 <?php
00010 class LanguageRuTest extends LanguageClassesTestCase {
00011 
00013         function testPluralFourForms( $result, $value ) {
00014                 $forms = array( 'one', 'few', 'many', 'other' );
00015                 $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
00016         }
00017 
00018         function providePluralFourForms() {
00019                 return array(
00020                         array( 'one', 1 ),
00021                         array( 'many', 11 ),
00022                         array( 'one', 91 ),
00023                         array( 'one', 121 ),
00024                         array( 'few', 2 ),
00025                         array( 'few', 3 ),
00026                         array( 'few', 4 ),
00027                         array( 'few', 334 ),
00028                         array( 'many', 5 ),
00029                         array( 'many', 15 ),
00030                         array( 'many', 120 ),
00031                 );
00032         }
00033 
00035         function testPluralTwoForms( $result, $value ) {
00036                 $forms = array( 'one', 'several' );
00037                 $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
00038         }
00039 
00040         function providePluralTwoForms() {
00041                 return array(
00042                         array( 'one', 1 ),
00043                         array( 'several', 11 ),
00044                         array( 'several', 91 ),
00045                         array( 'several', 121 ),
00046                 );
00047         }
00048 
00050         function testGrammar( $result, $word, $case ) {
00051                 $this->assertEquals( $result, $this->getLang()->convertGrammar( $word, $case ) );
00052         }
00053 
00054         function providerGrammar() {
00055                 return array(
00056                         array(
00057                                 'Википедии',
00058                                 'Википедия',
00059                                 'genitive',
00060                         ),
00061                         array(
00062                                 'Викитеки',
00063                                 'Викитека',
00064                                 'genitive',
00065                         ),
00066                         array(
00067                                 'Викитеке',
00068                                 'Викитека',
00069                                 'prepositional',
00070                         ),
00071                         array(
00072                                 'Викиданных',
00073                                 'Викиданные',
00074                                 'prepositional',
00075                         ),
00076                 );
00077         }
00078 }