Added release notes for 'ContentHandler::runLegacyHooks' removal
[mediawiki.git] / tests / phpunit / languages / classes / LanguageLtTest.php
blobdc7ef454a19b38ee10cf9598cad989a66ccb96b3
1 <?php
2 /**
3 * @author Santhosh Thottingal
4 * @copyright Copyright © 2012, Santhosh Thottingal
5 * @file
6 */
8 /** Tests for MediaWiki languages/LanguageLt.php */
9 class LanguageLtTest extends LanguageClassesTestCase {
10 /**
11 * @dataProvider providePlural
12 * @covers Language::convertPlural
14 public function testPlural( $result, $value ) {
15 $forms = [ 'one', 'few', 'other' ];
16 $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
19 /**
20 * @dataProvider providePlural
21 * @covers Language::getPluralRuleType
23 public function testGetPluralRuleType( $result, $value ) {
24 $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) );
27 public static function providePlural() {
28 return [
29 [ 'other', 0 ],
30 [ 'one', 1 ],
31 [ 'few', 2 ],
32 [ 'few', 9 ],
33 [ 'other', 10 ],
34 [ 'other', 11 ],
35 [ 'other', 20 ],
36 [ 'one', 21 ],
37 [ 'few', 32 ],
38 [ 'one', 41 ],
39 [ 'one', 40001 ],
43 /**
44 * @dataProvider providePluralTwoForms
45 * @covers Language::convertPlural
47 public function testOneFewPlural( $result, $value ) {
48 $forms = [ 'one', 'other' ];
49 // This fails for 21, but not sure why.
50 $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
53 public static function providePluralTwoForms() {
54 return [
55 [ 'one', 1 ],
56 [ 'other', 2 ],
57 [ 'other', 15 ],
58 [ 'other', 20 ],
59 [ 'one', 21 ],
60 [ 'other', 22 ],