Debian Codegraph @

tests/phpunit/includes/languages/LanguageRoTest.php

raw symbols SCIP
1 <?php
2 /**
3 * @author Amir E. Aharoni
4 * @copyright Copyright © 2012, Amir E. Aharoni
5 * @file
6 */
7
8 /**
9 * @group Language
10 */
11 class LanguageRoTest extends LanguageClassesTestCase {
12 /**
13 * @dataProvider providePlural
14 * @covers \MediaWiki\Language\Language::convertPlural
15 */
16 public function testPlural( $result, $value ) {
17 $forms = [ 'one', 'few', 'other' ];
18 $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
19 }
20
21 /**
22 * @dataProvider providePlural
23 * @covers \MediaWiki\Language\Language::getPluralRuleType
24 */
25 public function testGetPluralRuleType( $result, $value ) {
26 $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) );
27 }
28
29 public static function providePlural() {
30 return [
31 [ 'few', 0 ],
32 [ 'one', 1 ],
33 [ 'few', 2 ],
34 [ 'few', 19 ],
35 [ 'other', 20 ],
36 [ 'other', 99 ],
37 [ 'other', 100 ],
38 [ 'few', 101 ],
39 [ 'few', 119 ],
40 [ 'other', 120 ],
41 [ 'other', 200 ],
42 [ 'few', 201 ],
43 [ 'few', 219 ],
44 [ 'other', 220 ],
45 ];
46 }
47 }