Debian Codegraph @

tests/phpunit/includes/languages/LanguageCuTest.php

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