| 1 |
<?php |
| 2 |
|
| 3 |
|
| 4 |
> |
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
class LanguageSrTest extends LanguageClassesTestCase { |
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
public function testPlural( $result, $value ) { |
| 27 |
$forms = [ 'one', 'few', 'other' ]; |
| 28 |
$this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); |
| 29 |
} |
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
public function testGetPluralRuleType( $result, $value ) { |
| 36 |
$this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); |
| 37 |
} |
| 38 |
|
| 39 |
public static function providePlural() { |
| 40 |
return [ |
| 41 |
[ 'one', 1 ], |
| 42 |
[ 'other', 11 ], |
| 43 |
[ 'one', 91 ], |
| 44 |
[ 'one', 121 ], |
| 45 |
[ 'few', 2 ], |
| 46 |
[ 'few', 3 ], |
| 47 |
[ 'few', 4 ], |
| 48 |
[ 'few', 334 ], |
| 49 |
[ 'other', 5 ], |
| 50 |
[ 'other', 15 ], |
| 51 |
[ 'other', 120 ], |
| 52 |
]; |
| 53 |
} |
| 54 |
|
| 55 |
|
| 56 |
|
| 57 |
|
| 58 |
|
| 59 |
public function testPluralTwoForms( $result, $value ) { |
| 60 |
$forms = [ 'one', 'other' ]; |
| 61 |
$this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); |
| 62 |
} |
| 63 |
|
| 64 |
public static function providePluralTwoForms() { |
| 65 |
return [ |
| 66 |
[ 'one', 1 ], |
| 67 |
[ 'other', 11 ], |
| 68 |
[ 'other', 4 ], |
| 69 |
[ 'one', 91 ], |
| 70 |
[ 'one', 121 ], |
| 71 |
]; |
| 72 |
} |
| 73 |
|
| 74 |
} |