Localisation updates from https://translatewiki.net.
[mediawiki.git] / tests / phpunit / includes / languages / LanguageSmaTest.php
blobd807688f1e8b31108b9e3ed833b337ac2c437eff
1 <?php
2 /**
3 * @author Amir E. Aharoni
4 * @copyright Copyright © 2012, Amir E. Aharoni
5 * @file
6 */
8 /**
9 * @group Language
11 class LanguageSmaTest extends LanguageClassesTestCase {
12 /**
13 * @dataProvider providePlural
14 * @covers \MediaWiki\Language\Language::convertPlural
16 public function testPlural( $result, $value ) {
17 $forms = [ 'one', 'two', 'other' ];
18 $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
21 /**
22 * @dataProvider providePlural
23 * @covers \MediaWiki\Language\Language::getPluralRuleType
25 public function testGetPluralRuleType( $result, $value ) {
26 $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) );
29 public static function providePlural() {
30 return [
31 [ 'other', 0 ],
32 [ 'one', 1 ],
33 [ 'two', 2 ],
34 [ 'other', 3 ],
38 /**
39 * @dataProvider providePluralTwoForms
40 * @covers \MediaWiki\Language\Language::convertPlural
42 public function testPluralTwoForms( $result, $value ) {
43 $forms = [ 'one', 'other' ];
44 $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
47 public static function providePluralTwoForms() {
48 return [
49 [ 'other', 0 ],
50 [ 'one', 1 ],
51 [ 'other', 2 ],
52 [ 'other', 3 ],