Debian Codegraph @

tests/phpunit/includes/languages/LanguageGdTest.php

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