MediaWiki
REL1_24
|
00001 <?php 00002 00003 // @codingStandardsIgnoreStart Ignore Squiz.Classes.ValidClassName.NotCamelCaps 00004 class LanguageBe_taraskTest extends LanguageClassesTestCase { 00005 // @codingStandardsIgnoreEnd 00011 public function testBeTaraskTestsUsesBeTaraskCode() { 00012 $this->assertEquals( 'be-tarask', 00013 $this->getLang()->getCode() 00014 ); 00015 } 00016 00021 public function testSearchRightSingleQuotationMarkAsApostroph() { 00022 $this->assertEquals( 00023 "'", 00024 $this->getLang()->normalizeForSearch( '’' ), 00025 'bug 23156: U+2019 conversion to U+0027' 00026 ); 00027 } 00028 00033 public function testCommafy() { 00034 $this->assertEquals( '1,234,567', $this->getLang()->commafy( '1234567' ) ); 00035 $this->assertEquals( '12,345', $this->getLang()->commafy( '12345' ) ); 00036 } 00037 00042 public function testDoesNotCommafyFourDigitsNumber() { 00043 $this->assertEquals( '1234', $this->getLang()->commafy( '1234' ) ); 00044 } 00045 00050 public function testPlural( $result, $value ) { 00051 $forms = array( 'one', 'few', 'many', 'other' ); 00052 $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); 00053 } 00054 00059 public function testGetPluralRuleType( $result, $value ) { 00060 $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); 00061 } 00062 00063 public static function providePlural() { 00064 return array( 00065 array( 'one', 1 ), 00066 array( 'many', 11 ), 00067 array( 'one', 91 ), 00068 array( 'one', 121 ), 00069 array( 'few', 2 ), 00070 array( 'few', 3 ), 00071 array( 'few', 4 ), 00072 array( 'few', 334 ), 00073 array( 'many', 5 ), 00074 array( 'many', 15 ), 00075 array( 'many', 120 ), 00076 ); 00077 } 00078 00083 public function testPluralTwoForms( $result, $value ) { 00084 $forms = array( '1=one', 'other' ); 00085 $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); 00086 } 00087 00088 public static function providePluralTwoForms() { 00089 return array( 00090 array( 'other', 0 ), 00091 array( 'one', 1 ), 00092 array( 'other', 11 ), 00093 array( 'other', 91 ), 00094 array( 'other', 121 ), 00095 ); 00096 } 00097 }