Localisation updates from http://translatewiki.net.
[mediawiki.git] / tests / phpunit / languages / LanguageBe_taraskTest.php
blob765cdb8faeca56d0a58be4f59432c063d930dd5b
1 <?php
3 class LanguageBeTaraskTest extends MediaWikiTestCase {
4 private $lang;
6 function setUp() {
7 $this->lang = Language::factory( 'Be-tarask' );
9 function tearDown() {
10 unset( $this->lang );
13 /** see bug 23156 & r64981 */
14 function testSearchRightSingleQuotationMarkAsApostroph() {
15 $this->assertEquals(
16 "'",
17 $this->lang->normalizeForSearch( '’' ),
18 'bug 23156: U+2019 conversion to U+0027'
21 /** see bug 23156 & r64981 */
22 function testCommafy() {
23 $this->assertEquals( '1,234,567', $this->lang->commafy( '1234567' ) );
24 $this->assertEquals( '12,345', $this->lang->commafy( '12345' ) );
26 /** see bug 23156 & r64981 */
27 function testDoesNotCommafyFourDigitsNumber() {
28 $this->assertEquals( '1234', $this->lang->commafy( '1234' ) );
30 /** @dataProvider providePluralFourForms */
31 function testPluralFourForms( $result, $value ) {
32 $forms = array( 'one', 'few', 'many', 'other' );
33 $this->assertEquals( $result, $this->lang->convertPlural( $value, $forms ) );
36 function providePluralFourForms() {
37 return array (
38 array( 'one', 1 ),
39 array( 'many', 11 ),
40 array( 'one', 91 ),
41 array( 'one', 121 ),
42 array( 'few', 2 ),
43 array( 'few', 3 ),
44 array( 'few', 4 ),
45 array( 'few', 334 ),
46 array( 'many', 5 ),
47 array( 'many', 15 ),
48 array( 'many', 120 ),
51 /** @dataProvider providePluralTwoForms */
52 function testPluralTwoForms( $result, $value ) {
53 $forms = array( 'one', 'several' );
54 $this->assertEquals( $result, $this->lang->convertPlural( $value, $forms ) );
56 function providePluralTwoForms() {
57 return array (
58 array( 'one', 1 ),
59 array( 'several', 11 ),
60 array( 'several', 91 ),
61 array( 'several', 121 ),