Move Test files under same folder structure where class is (/languages/)
[lhc/web/wiklou.git] / tests / phpunit / languages / classes / LanguageLtTest.php
1 <?php
2 /**
3 * @author Santhosh Thottingal
4 * @copyright Copyright © 2012, Santhosh Thottingal
5 * @file
6 */
7
8 /** Tests for MediaWiki languages/LanguageLt.php */
9 class LanguageLtTest extends LanguageClassesTestCase {
10 /**
11 * @dataProvider providePlural
12 * @covers Language::convertPlural
13 */
14 public function testPlural( $result, $value ) {
15 $forms = array( 'one', 'few', 'other' );
16 $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
17 }
18
19 /**
20 * @dataProvider providePlural
21 * @covers Language::getPluralRuleType
22 */
23 public function testGetPluralRuleType( $result, $value ) {
24 $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) );
25 }
26
27 public static function providePlural() {
28 return array(
29 array( 'other', 0 ),
30 array( 'one', 1 ),
31 array( 'few', 2 ),
32 array( 'few', 9 ),
33 array( 'other', 10 ),
34 array( 'other', 11 ),
35 array( 'other', 20 ),
36 array( 'one', 21 ),
37 array( 'few', 32 ),
38 array( 'one', 41 ),
39 array( 'one', 40001 ),
40 );
41 }
42
43 /**
44 * @dataProvider providePluralTwoForms
45 * @covers Language::convertPlural
46 */
47 public function testOneFewPlural( $result, $value ) {
48 $forms = array( 'one', 'other' );
49 // This fails for 21, but not sure why.
50 $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
51 }
52
53 public static function providePluralTwoForms() {
54 return array(
55 array( 'one', 1 ),
56 array( 'other', 2 ),
57 array( 'other', 15 ),
58 array( 'other', 20 ),
59 array( 'one', 21 ),
60 array( 'other', 22 ),
61 );
62 }
63 }