MediaWiki
REL1_22
|
00001 <?php 00009 class LanguageLtTest extends LanguageClassesTestCase { 00014 public function testPlural( $result, $value ) { 00015 $forms = array( 'one', 'few', '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( 'other', 0 ), 00030 array( 'one', 1 ), 00031 array( 'few', 2 ), 00032 array( 'few', 9 ), 00033 array( 'other', 10 ), 00034 array( 'other', 11 ), 00035 array( 'other', 20 ), 00036 array( 'one', 21 ), 00037 array( 'few', 32 ), 00038 array( 'one', 41 ), 00039 array( 'one', 40001 ), 00040 ); 00041 } 00042 00047 public function testOneFewPlural( $result, $value ) { 00048 $forms = array( 'one', 'other' ); 00049 // This fails for 21, but not sure why. 00050 $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); 00051 } 00052 00053 public static function providePluralTwoForms() { 00054 return array( 00055 array( 'one', 1 ), 00056 array( 'other', 2 ), 00057 array( 'other', 15 ), 00058 array( 'other', 20 ), 00059 array( 'one', 21 ), 00060 array( 'other', 22 ), 00061 ); 00062 } 00063 }