More complete, more straightforward JobQueueMemoryTest
[mediawiki.git] / tests / phpunit / languages / classes / LanguageGdTest.php
blobb89b4df9bd0c8598a1d37ec08f5e3755c81ed075
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 = array( 'one', 'two', 'few', 'other' );
16 $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
19 public static function providerPlural() {
20 return array(
21 array( 'other', 0 ),
22 array( 'one', 1 ),
23 array( 'two', 2 ),
24 array( 'one', 11 ),
25 array( 'two', 12 ),
26 array( 'few', 3 ),
27 array( 'few', 19 ),
28 array( 'other', 200 ),
32 /**
33 * @dataProvider providerPluralExplicit
34 * @covers Language::convertPlural
36 public function testExplicitPlural( $result, $value ) {
37 $forms = array( 'one', 'two', 'few', 'other', '11=Form11', '12=Form12' );
38 $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
41 public static function providerPluralExplicit() {
42 return array(
43 array( 'other', 0 ),
44 array( 'one', 1 ),
45 array( 'two', 2 ),
46 array( 'Form11', 11 ),
47 array( 'Form12', 12 ),
48 array( 'few', 3 ),
49 array( 'few', 19 ),
50 array( 'other', 200 ),