test: coverage recording now needs to be explicit
[mediawiki.git] / tests / phpunit / languages / LanguageBe_taraskTest.php
blob3fcc0e58347bf7c6766150cabc53cd68a267db7b
1 <?php
3 class LanguageBe_taraskTest extends LanguageClassesTestCase {
4 /**
5 * Make sure the language code we are given is indeed
6 * be-tarask. This is to ensure LanguageClassesTestCase
7 * does not give us the wrong language.
8 */
9 function testBeTaraskTestsUsesBeTaraskCode() {
10 $this->assertEquals( 'be-tarask',
11 $this->getLang()->getCode()
15 /** see bug 23156 & r64981 */
16 function testSearchRightSingleQuotationMarkAsApostroph() {
17 $this->assertEquals(
18 "'",
19 $this->getLang()->normalizeForSearch( '’' ),
20 'bug 23156: U+2019 conversion to U+0027'
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' ) );
30 /** see bug 23156 & r64981 */
31 function testDoesNotCommafyFourDigitsNumber() {
32 $this->assertEquals( '1234', $this->getLang()->commafy( '1234' ) );
35 /** @dataProvider providePlural */
36 function testPlural( $result, $value ) {
37 $forms = array( 'one', 'few', 'many', 'other' );
38 $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
41 /** @dataProvider providePlural */
42 function testGetPluralRuleType( $result, $value ) {
43 $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) );
46 public static function providePlural() {
47 return array(
48 array( 'one', 1 ),
49 array( 'many', 11 ),
50 array( 'one', 91 ),
51 array( 'one', 121 ),
52 array( 'few', 2 ),
53 array( 'few', 3 ),
54 array( 'few', 4 ),
55 array( 'few', 334 ),
56 array( 'many', 5 ),
57 array( 'many', 15 ),
58 array( 'many', 120 ),
62 /** @dataProvider providePluralTwoForms */
63 function testPluralTwoForms( $result, $value ) {
64 $forms = array( 'one', 'other' );
65 $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
68 public static function providePluralTwoForms() {
69 return array(
70 array( 'one', 1 ),
71 array( 'other', 11 ),
72 array( 'other', 91 ),
73 array( 'other', 121 ),