MediaWiki
REL1_21
|
00001 <?php 00002 00003 class LanguageBe_taraskTest extends LanguageClassesTestCase { 00004 00010 function testBeTaraskTestsUsesBeTaraskCode() { 00011 $this->assertEquals( 'be-tarask', 00012 $this->getLang()->getCode() 00013 ); 00014 } 00015 00017 function testSearchRightSingleQuotationMarkAsApostroph() { 00018 $this->assertEquals( 00019 "'", 00020 $this->getLang()->normalizeForSearch( '’' ), 00021 'bug 23156: U+2019 conversion to U+0027' 00022 ); 00023 } 00024 00026 function testCommafy() { 00027 $this->assertEquals( '1,234,567', $this->getLang()->commafy( '1234567' ) ); 00028 $this->assertEquals( '12,345', $this->getLang()->commafy( '12345' ) ); 00029 } 00030 00032 function testDoesNotCommafyFourDigitsNumber() { 00033 $this->assertEquals( '1234', $this->getLang()->commafy( '1234' ) ); 00034 } 00035 00037 function testPluralFourForms( $result, $value ) { 00038 $forms = array( 'one', 'few', 'many', 'other' ); 00039 $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); 00040 } 00041 00042 function providePluralFourForms() { 00043 return array( 00044 array( 'one', 1 ), 00045 array( 'many', 11 ), 00046 array( 'one', 91 ), 00047 array( 'one', 121 ), 00048 array( 'few', 2 ), 00049 array( 'few', 3 ), 00050 array( 'few', 4 ), 00051 array( 'few', 334 ), 00052 array( 'many', 5 ), 00053 array( 'many', 15 ), 00054 array( 'many', 120 ), 00055 ); 00056 } 00057 00059 function testPluralTwoForms( $result, $value ) { 00060 $forms = array( 'one', 'several' ); 00061 $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); 00062 } 00063 00064 function providePluralTwoForms() { 00065 return array( 00066 array( 'one', 1 ), 00067 array( 'several', 11 ), 00068 array( 'several', 91 ), 00069 array( 'several', 121 ), 00070 ); 00071 } 00072 00073 }