Merge "list=allusers&aurights=[unusedright] returns all users of the wiki"
[lhc/web/wiklou.git] / tests / phpunit / languages / LanguageBe_taraskTest.php
1 <?php
2
3 class LanguageBe_taraskTest extends LanguageClassesTestCase {
4
5 /**
6 * Make sure the language code we are given is indeed
7 * be-tarask. This is to ensure LanguageClassesTestCase
8 * does not give us the wrong language.
9 */
10 function testBeTaraskTestsUsesBeTaraskCode() {
11 $this->assertEquals( 'be-tarask',
12 $this->getLang()->getCode()
13 );
14 }
15
16 /** see bug 23156 & r64981 */
17 function testSearchRightSingleQuotationMarkAsApostroph() {
18 $this->assertEquals(
19 "'",
20 $this->getLang()->normalizeForSearch( '’' ),
21 'bug 23156: U+2019 conversion to U+0027'
22 );
23 }
24 /** see bug 23156 & r64981 */
25 function testCommafy() {
26 $this->assertEquals( '1,234,567', $this->getLang()->commafy( '1234567' ) );
27 $this->assertEquals( '12,345', $this->getLang()->commafy( '12345' ) );
28 }
29 /** see bug 23156 & r64981 */
30 function testDoesNotCommafyFourDigitsNumber() {
31 $this->assertEquals( '1234', $this->getLang()->commafy( '1234' ) );
32 }
33 /** @dataProvider providePluralFourForms */
34 function testPluralFourForms( $result, $value ) {
35 $forms = array( 'one', 'few', 'many', 'other' );
36 $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
37 }
38
39 function providePluralFourForms() {
40 return array (
41 array( 'one', 1 ),
42 array( 'many', 11 ),
43 array( 'one', 91 ),
44 array( 'one', 121 ),
45 array( 'few', 2 ),
46 array( 'few', 3 ),
47 array( 'few', 4 ),
48 array( 'few', 334 ),
49 array( 'many', 5 ),
50 array( 'many', 15 ),
51 array( 'many', 120 ),
52 );
53 }
54 /** @dataProvider providePluralTwoForms */
55 function testPluralTwoForms( $result, $value ) {
56 $forms = array( 'one', 'several' );
57 $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
58 }
59 function providePluralTwoForms() {
60 return array (
61 array( 'one', 1 ),
62 array( 'several', 11 ),
63 array( 'several', 91 ),
64 array( 'several', 121 ),
65 );
66 }
67
68 }