| 1 |
<?php |
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
class LanguageBe_taraskTest extends LanguageClassesTestCase { |
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
public function testBeTaraskTestsUsesBeTaraskCode() { |
| 18 |
$this->assertEquals( 'be-tarask', |
| 19 |
$this->getLang()->getCode() |
| 20 |
); |
| 21 |
} |
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
public function testSearchRightSingleQuotationMarkAsApostroph() { |
| 28 |
$this->assertEquals( |
| 29 |
"'", |
| 30 |
$this->getLang()->normalizeForSearch( '’' ), |
| 31 |
'T25156: U+2019 conversion to U+0027' |
| 32 |
); |
| 33 |
} |
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
|
| 39 |
public function testFormatNum() { |
| 40 |
$this->assertEquals( '1 234 567', $this->getLang()->formatNum( '1234567' ) ); |
| 41 |
$this->assertEquals( '12 345', $this->getLang()->formatNum( '12345' ) ); |
| 42 |
} |
| 43 |
|
| 44 |
|
| 45 |
|
| 46 |
|
| 47 |
|
| 48 |
public function testDoesNotCommafyFourDigitsNumber() { |
| 49 |
$this->assertSame( '1234', $this->getLang()->formatNum( '1234' ) ); |
| 50 |
} |
| 51 |
|
| 52 |
|
| 53 |
|
| 54 |
|
| 55 |
|
| 56 |
public function testPlural( $result, $value ) { |
| 57 |
$forms = [ 'one', 'few', 'many', 'other' ]; |
| 58 |
$this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); |
| 59 |
} |
| 60 |
|
| 61 |
|
| 62 |
|
| 63 |
|
| 64 |
|
| 65 |
public function testGetPluralRuleType( $result, $value ) { |
| 66 |
$this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); |
| 67 |
} |
| 68 |
|
| 69 |
public static function providePlural() { |
| 70 |
return [ |
| 71 |
[ 'one', 1 ], |
| 72 |
[ 'many', 11 ], |
| 73 |
[ 'one', 91 ], |
| 74 |
[ 'one', 121 ], |
| 75 |
[ 'few', 2 ], |
| 76 |
[ 'few', 3 ], |
| 77 |
[ 'few', 4 ], |
| 78 |
[ 'few', 334 ], |
| 79 |
[ 'many', 5 ], |
| 80 |
[ 'many', 15 ], |
| 81 |
[ 'many', 120 ], |
| 82 |
]; |
| 83 |
} |
| 84 |
|
| 85 |
|
| 86 |
|
| 87 |
|
| 88 |
|
| 89 |
public function testPluralTwoForms( $result, $value ) { |
| 90 |
$forms = [ '1=one', 'other' ]; |
| 91 |
$this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); |
| 92 |
} |
| 93 |
|
| 94 |
public static function providePluralTwoForms() { |
| 95 |
return [ |
| 96 |
[ 'other', 0 ], |
| 97 |
[ 'one', 1 ], |
| 98 |
[ 'other', 11 ], |
| 99 |
[ 'other', 91 ], |
| 100 |
[ 'other', 121 ], |
| 101 |
]; |
| 102 |
} |
| 103 |
} |