Index: trunk/phase3/tests/phpunit/languages/LanguageSrTest.php |
— | — | @@ -96,9 +96,43 @@ |
97 | 97 | $this->assertEquals( 'абцдšđžčć', |
98 | 98 | $this->convertToLatin( 'абцдšđžčć' ) |
99 | 99 | ); |
| 100 | + } |
100 | 101 | |
| 102 | + /** @dataProvider providePluralFourForms */ |
| 103 | + function testPluralFourForms( $result, $value ) { |
| 104 | + $forms = array( 'one', 'few', 'many', 'other' ); |
| 105 | + $this->assertEquals( $result, $this->lang->convertPlural( $value, $forms ) ); |
101 | 106 | } |
102 | 107 | |
| 108 | + function providePluralFourForms() { |
| 109 | + return array ( |
| 110 | + array( 'one', 1 ), |
| 111 | + array( 'many', 11 ), |
| 112 | + array( 'one', 91 ), |
| 113 | + array( 'one', 121 ), |
| 114 | + array( 'few', 2 ), |
| 115 | + array( 'few', 3 ), |
| 116 | + array( 'few', 4 ), |
| 117 | + array( 'few', 334 ), |
| 118 | + array( 'many', 5 ), |
| 119 | + array( 'many', 15 ), |
| 120 | + array( 'many', 120 ), |
| 121 | + ); |
| 122 | + } |
| 123 | + /** @dataProvider providePluralTwoForms */ |
| 124 | + function testPluralTwoForms( $result, $value ) { |
| 125 | + $forms = array( 'one', 'several' ); |
| 126 | + $this->assertEquals( $result, $this->lang->convertPlural( $value, $forms ) ); |
| 127 | + } |
| 128 | + function providePluralTwoForms() { |
| 129 | + return array ( |
| 130 | + array( 'one', 1 ), |
| 131 | + array( 'several', 11 ), |
| 132 | + array( 'several', 91 ), |
| 133 | + array( 'several', 121 ), |
| 134 | + ); |
| 135 | + } |
| 136 | + |
103 | 137 | ##### HELPERS ##################################################### |
104 | 138 | /** |
105 | 139 | *Wrapper to verify text stay the same after applying conversion |