MediaWiki  REL1_22
LanguageBe_taraskTest.php
Go to the documentation of this file.
00001 <?php
00002 
00003 class LanguageBe_taraskTest extends LanguageClassesTestCase {
00009     public function testBeTaraskTestsUsesBeTaraskCode() {
00010         $this->assertEquals( 'be-tarask',
00011             $this->getLang()->getCode()
00012         );
00013     }
00014 
00019     public function testSearchRightSingleQuotationMarkAsApostroph() {
00020         $this->assertEquals(
00021             "'",
00022             $this->getLang()->normalizeForSearch( '’' ),
00023             'bug 23156: U+2019 conversion to U+0027'
00024         );
00025     }
00026 
00031     public function testCommafy() {
00032         $this->assertEquals( '1,234,567', $this->getLang()->commafy( '1234567' ) );
00033         $this->assertEquals( '12,345', $this->getLang()->commafy( '12345' ) );
00034     }
00035 
00040     public function testDoesNotCommafyFourDigitsNumber() {
00041         $this->assertEquals( '1234', $this->getLang()->commafy( '1234' ) );
00042     }
00043 
00048     public function testPlural( $result, $value ) {
00049         $forms = array( 'one', 'few', 'many', 'other' );
00050         $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
00051     }
00052 
00057     public function testGetPluralRuleType( $result, $value ) {
00058         $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) );
00059     }
00060 
00061     public static function providePlural() {
00062         return array(
00063             array( 'one', 1 ),
00064             array( 'many', 11 ),
00065             array( 'one', 91 ),
00066             array( 'one', 121 ),
00067             array( 'few', 2 ),
00068             array( 'few', 3 ),
00069             array( 'few', 4 ),
00070             array( 'few', 334 ),
00071             array( 'many', 5 ),
00072             array( 'many', 15 ),
00073             array( 'many', 120 ),
00074         );
00075     }
00076 
00081     public function testPluralTwoForms( $result, $value ) {
00082         $forms = array( '1=one', 'other' );
00083         $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
00084     }
00085 
00086     public static function providePluralTwoForms() {
00087         return array(
00088             array( 'other', 0 ),
00089             array( 'one', 1 ),
00090             array( 'other', 11 ),
00091             array( 'other', 91 ),
00092             array( 'other', 121 ),
00093         );
00094     }
00095 }