| 1 |
<?php |
| 2 |
|
| 3 |
|
| 4 |
i |
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
class LanguageHeTest extends LanguageClassesTestCase { |
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
public function testTwoPluralForms( $result, $value ) { |
| 34 |
$forms = [ 'one', 'other' ]; |
| 35 |
$this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); |
| 36 |
} |
| 37 |
|
| 38 |
|
| 39 |
|
| 40 |
|
| 41 |
|
| 42 |
public function testThreePluralForms( $result, $value ) { |
| 43 |
$forms = [ 'one', 'two', 'other' ]; |
| 44 |
$this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); |
| 45 |
} |
| 46 |
|
| 47 |
|
| 48 |
|
| 49 |
|
| 50 |
|
| 51 |
public function testFourPluralForms( $result, $value ) { |
| 52 |
$forms = [ 'one', 'two', 'many', 'other' ]; |
| 53 |
$this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); |
| 54 |
} |
| 55 |
|
| 56 |
|
| 57 |
|
| 58 |
|
| 59 |
|
| 60 |
public function testGetPluralRuleType( $result, $value ) { |
| 61 |
$this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); |
| 62 |
} |
| 63 |
|
| 64 |
public static function provideTwoPluralForms() { |
| 65 |
return [ |
| 66 |
[ 'other', 0 ], |
| 67 |
[ 'one', 1 ], |
| 68 |
[ 'other', 2 ], |
| 69 |
[ 'other', 3 ], |
| 70 |
[ 'other', 10 ], |
| 71 |
[ 'other', 20 ], |
| 72 |
]; |
| 73 |
} |
| 74 |
|
| 75 |
public static function provideThreePluralForms() { |
| 76 |
return [ |
| 77 |
[ 'other', 0 ], |
| 78 |
[ 'one', 1 ], |
| 79 |
[ 'two', 2 ], |
| 80 |
[ 'other', 3 ], |
| 81 |
[ 'other', 10 ], |
| 82 |
[ 'other', 20 ], |
| 83 |
]; |
| 84 |
} |
| 85 |
|
| 86 |
public static function provideFourPluralForms() { |
| 87 |
return [ |
| 88 |
[ 'other', 0 ], |
| 89 |
[ 'one', 1 ], |
| 90 |
[ 'two', 2 ], |
| 91 |
[ 'other', 3 ], |
| 92 |
[ 'other', 10 ], |
| 93 |
[ 'many', 20 ], |
| 94 |
]; |
| 95 |
} |
| 96 |
|
| 97 |
|
| 98 |
|
| 99 |
|
| 100 |
|
| 101 |
public function testGrammar( $result, $word, $case ) { |
| 102 |
$this->assertEquals( $result, $this->getLang()->convertGrammar( $word, $case ) ); |
| 103 |
} |
| 104 |
|
| 105 |
|
| 106 |
|
| 107 |
|
| 108 |
|
| 109 |
public static function provideGrammar() { |
| 110 |
return [ |
| 111 |
[ |
| 112 |
'וויקיפדיה', |
| 113 |
'ויקיפדיה', |
| 114 |
'תחילית', |
| 115 |
], |
| 116 |
[ |
| 117 |
'וולפגנג', |
| 118 |
'וולפגנג', |
| 119 |
'prefixed', |
| 120 |
], |
| 121 |
[ |
| 122 |
'קובץ', |
| 123 |
'הקובץ', |
| 124 |
'תחילית', |
| 125 |
], |
| 126 |
[ |
| 127 |
'־Wikipedia', |
| 128 |
'Wikipedia', |
| 129 |
'תחילית', |
| 130 |
], |
| 131 |
[ |
| 132 |
'־1995', |
| 133 |
'1995', |
| 134 |
'תחילית', |
| 135 |
], |
| 136 |
]; |
| 137 |
} |
| 138 |
} |