Merge "Update docs/hooks.txt for ShowSearchHitTitle"
[mediawiki.git] / tests / phpunit / languages / classes / LanguageGdTest.php
blob4be4fdedb9b4bfa24b6c48d4204a0fe10919d0e5
1 <?php
2 /**
3 * @author Santhosh Thottingal
4 * @copyright Copyright © 2012-2013, Santhosh Thottingal
5 * @file
6 */
8 /** Tests for MediaWiki languages/classes/LanguageGd.php */
9 class LanguageGdTest extends LanguageClassesTestCase {
10 /**
11 * @dataProvider providerPlural
12 * @covers Language::convertPlural
14 public function testPlural( $result, $value ) {
15 $forms = [ 'one', 'two', 'few', 'other' ];
16 $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
19 public static function providerPlural() {
20 return [
21 [ 'other', 0 ],
22 [ 'one', 1 ],
23 [ 'two', 2 ],
24 [ 'one', 11 ],
25 [ 'two', 12 ],
26 [ 'few', 3 ],
27 [ 'few', 19 ],
28 [ 'other', 200 ],
32 /**
33 * @dataProvider providerPluralExplicit
34 * @covers Language::convertPlural
36 public function testExplicitPlural( $result, $value ) {
37 $forms = [ 'one', 'two', 'few', 'other', '11=Form11', '12=Form12' ];
38 $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
41 public static function providerPluralExplicit() {
42 return [
43 [ 'other', 0 ],
44 [ 'one', 1 ],
45 [ 'two', 2 ],
46 [ 'Form11', 11 ],
47 [ 'Form12', 12 ],
48 [ 'few', 3 ],
49 [ 'few', 19 ],
50 [ 'other', 200 ],