MediaWiki  REL1_22
LanguageMtTest.php
Go to the documentation of this file.
00001 <?php
00009 class LanguageMtTest extends LanguageClassesTestCase {
00014     public function testPlural( $result, $value ) {
00015         $forms = array( 'one', 'few', 'many', 'other' );
00016         $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
00017     }
00018 
00023     public function testGetPluralRuleType( $result, $value ) {
00024         $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) );
00025     }
00026 
00027     public static function providePlural() {
00028         return array(
00029             array( 'few', 0 ),
00030             array( 'one', 1 ),
00031             array( 'few', 2 ),
00032             array( 'few', 10 ),
00033             array( 'many', 11 ),
00034             array( 'many', 19 ),
00035             array( 'other', 20 ),
00036             array( 'other', 99 ),
00037             array( 'other', 100 ),
00038             array( 'other', 101 ),
00039             array( 'few', 102 ),
00040             array( 'few', 110 ),
00041             array( 'many', 111 ),
00042             array( 'many', 119 ),
00043             array( 'other', 120 ),
00044             array( 'other', 201 ),
00045         );
00046     }
00047 
00052     public function testPluralTwoForms( $result, $value ) {
00053         $forms = array( 'one', 'other' );
00054         $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
00055     }
00056 
00057     public static function providePluralTwoForms() {
00058         return array(
00059             array( 'other', 0 ),
00060             array( 'one', 1 ),
00061             array( 'other', 2 ),
00062             array( 'other', 10 ),
00063             array( 'other', 11 ),
00064             array( 'other', 19 ),
00065             array( 'other', 20 ),
00066             array( 'other', 99 ),
00067             array( 'other', 100 ),
00068             array( 'other', 101 ),
00069             array( 'other', 102 ),
00070             array( 'other', 110 ),
00071             array( 'other', 111 ),
00072             array( 'other', 119 ),
00073             array( 'other', 120 ),
00074             array( 'other', 201 ),
00075         );
00076     }
00077 }