| 1 |
<?php |
| 2 |
|
| 3 |
|
| 4 |
l |
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
class LanguageLvTest extends LanguageClassesTestCase { |
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
public function testPlural( $result, $value ) { |
| 19 |
$forms = [ 'zero', 'one', 'other' ]; |
| 20 |
$this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); |
| 21 |
} |
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
public function testGetPluralRuleType( $result, $value ) { |
| 28 |
$this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); |
| 29 |
} |
| 30 |
|
| 31 |
public static function providePlural() { |
| 32 |
return [ |
| 33 |
[ 'zero', 0 ], |
| 34 |
[ 'one', 1 ], |
| 35 |
[ 'zero', 11 ], |
| 36 |
[ 'one', 21 ], |
| 37 |
[ 'zero', 411 ], |
| 38 |
[ 'other', 2 ], |
| 39 |
[ 'other', 9 ], |
| 40 |
[ 'zero', 12 ], |
| 41 |
[ 'other', 12.345 ], |
| 42 |
[ 'zero', 20 ], |
| 43 |
[ 'other', 22 ], |
| 44 |
[ 'one', 31 ], |
| 45 |
[ 'zero', 200 ], |
| 46 |
]; |
| 47 |
} |
| 48 |
} |