(bug 37755) Set robot meta tags for 'view source' pages
[lhc/web/wiklou.git] / tests / phpunit / languages / LanguageBe_taraskTest.php
1 <?php
2
3 class LanguageBeTaraskTest extends MediaWikiTestCase {
4 private $lang;
5
6 protected function setUp() {
7 $this->lang = Language::factory( 'Be-tarask' );
8 }
9 protected function tearDown() {
10 unset( $this->lang );
11 }
12
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'
19 );
20 }
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' ) );
25 }
26 /** see bug 23156 & r64981 */
27 function testDoesNotCommafyFourDigitsNumber() {
28 $this->assertEquals( '1234', $this->lang->commafy( '1234' ) );
29 }
30 /** @dataProvider providePluralFourForms */
31 function testPluralFourForms( $result, $value ) {
32 $forms = array( 'one', 'few', 'many', 'other' );
33 $this->assertEquals( $result, $this->lang->convertPlural( $value, $forms ) );
34 }
35
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 ),
49 );
50 }
51 /** @dataProvider providePluralTwoForms */
52 function testPluralTwoForms( $result, $value ) {
53 $forms = array( 'one', 'several' );
54 $this->assertEquals( $result, $this->lang->convertPlural( $value, $forms ) );
55 }
56 function providePluralTwoForms() {
57 return array (
58 array( 'one', 1 ),
59 array( 'several', 11 ),
60 array( 'several', 91 ),
61 array( 'several', 121 ),
62 );
63 }
64
65 }