Debian Codegraph @

tests/phpunit/includes/languages/LanguageGvTest.php

raw symbols SCIP
1 <?php
2 /**
3 * @author Santhosh Thottingal
4 * @copyright Copyright © 2013, Santhosh Thottingal
5 * @file
6 */
7
8 /**
9 * Tests for Manx (Gaelg)
10 *
11 * @group Language
12 */
13 class LanguageGvTest extends LanguageClassesTestCase {
14 /**
15 * @dataProvider providePlural
16 * @covers \MediaWiki\Language\Language::convertPlural
17 */
18 public function testPlural( $result, $value ) {
19 $forms = [ 'one', 'two', 'few', 'other' ];
20 $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
21 }
22
23 /**
24 * @dataProvider providePlural
25 * @covers \MediaWiki\Language\Language::getPluralRuleType
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 [ 'few', 0 ],
34 [ 'one', 1 ],
35 [ 'two', 2 ],
36 [ 'other', 3 ],
37 [ 'few', 20 ],
38 [ 'one', 21 ],
39 [ 'two', 22 ],
40 [ 'other', 23 ],
41 [ 'other', 50 ],
42 [ 'few', 60 ],
43 [ 'few', 80 ],
44 [ 'few', 100 ]
45 ];
46 }
47 }