MediaWiki  REL1_19
LanguageBe_taraskTest.php
Go to the documentation of this file.
00001 <?php
00002 
00003 class LanguageBeTaraskTest extends MediaWikiTestCase {
00004         private $lang;
00005 
00006         function setUp() {
00007                 $this->lang = Language::factory( 'Be-tarask' );
00008         }
00009         function tearDown() {
00010                 unset( $this->lang );
00011         }
00012 
00014         function testSearchRightSingleQuotationMarkAsApostroph() {
00015                 $this->assertEquals(
00016                         "'",
00017                         $this->lang->normalizeForSearch( '’' ),
00018                         'bug 23156: U+2019 conversion to U+0027'
00019                 );
00020         }
00022         function testCommafy() {
00023                 $this->assertEquals( '1,234,567', $this->lang->commafy( '1234567' ) );
00024                 $this->assertEquals(    '12,345', $this->lang->commafy(   '12345' ) );
00025         }
00027         function testDoesNotCommafyFourDigitsNumber() {
00028                 $this->assertEquals(      '1234', $this->lang->commafy(    '1234' ) );
00029         }
00031         function testPluralFourForms( $result, $value ) {
00032                 $forms =  array( 'one', 'few', 'many', 'other' );
00033                 $this->assertEquals( $result, $this->lang->convertPlural( $value, $forms ) );
00034         }
00035 
00036         function providePluralFourForms() {
00037                 return array (
00038                         array( 'one', 1 ),
00039                         array( 'many', 11 ),
00040                         array( 'one', 91 ),
00041                         array( 'one', 121 ),
00042                         array( 'few', 2 ),
00043                         array( 'few', 3 ),
00044                         array( 'few', 4 ),
00045                         array( 'few', 334 ),
00046                         array( 'many', 5 ),
00047                         array( 'many', 15 ),
00048                         array( 'many', 120 ),
00049                 );
00050         }
00052         function testPluralTwoForms( $result, $value ) {
00053                 $forms =  array( 'one', 'several' );
00054                 $this->assertEquals( $result, $this->lang->convertPlural( $value, $forms ) );
00055         }
00056         function providePluralTwoForms() {
00057                 return array (
00058                         array( 'one', 1 ),
00059                         array( 'several', 11 ),
00060                         array( 'several', 91 ),
00061                         array( 'several', 121 ),
00062                 );
00063         }
00064 
00065 }