MediaWiki  master
LanguageBe_taraskTest.php
Go to the documentation of this file.
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         }
00025         function testCommafy() {
00026                 $this->assertEquals( '1,234,567', $this->getLang()->commafy( '1234567' ) );
00027                 $this->assertEquals(    '12,345', $this->getLang()->commafy(   '12345' ) );
00028         }
00030         function testDoesNotCommafyFourDigitsNumber() {
00031                 $this->assertEquals(      '1234', $this->getLang()->commafy(    '1234' ) );
00032         }
00034         function testPluralFourForms( $result, $value ) {
00035                 $forms =  array( 'one', 'few', 'many', 'other' );
00036                 $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
00037         }
00038 
00039         function providePluralFourForms() {
00040                 return array (
00041                         array( 'one', 1 ),
00042                         array( 'many', 11 ),
00043                         array( 'one', 91 ),
00044                         array( 'one', 121 ),
00045                         array( 'few', 2 ),
00046                         array( 'few', 3 ),
00047                         array( 'few', 4 ),
00048                         array( 'few', 334 ),
00049                         array( 'many', 5 ),
00050                         array( 'many', 15 ),
00051                         array( 'many', 120 ),
00052                 );
00053         }
00055         function testPluralTwoForms( $result, $value ) {
00056                 $forms =  array( 'one', 'several' );
00057                 $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
00058         }
00059         function providePluralTwoForms() {
00060                 return array (
00061                         array( 'one', 1 ),
00062                         array( 'several', 11 ),
00063                         array( 'several', 91 ),
00064                         array( 'several', 121 ),
00065                 );
00066         }
00067 
00068 }