Debian Codegraph @

tests/phpunit/includes/languages/LanguageBsTest.php

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