MediaWiki REL1_30
LanguageSeTest.php
Go to the documentation of this file.
1<?php
14 public function testPlural( $result, $value ) {
15 $forms = [ 'one', 'two', 'other' ];
16 $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
17 }
18
23 public function testGetPluralRuleType( $result, $value ) {
24 $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) );
25 }
26
27 public static function providePlural() {
28 return [
29 [ 'other', 0 ],
30 [ 'one', 1 ],
31 [ 'two', 2 ],
32 [ 'other', 3 ],
33 ];
34 }
35
40 public function testPluralTwoForms( $result, $value ) {
41 $forms = [ 'one', 'other' ];
42 $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
43 }
44
45 public static function providePluralTwoForms() {
46 return [
47 [ 'other', 0 ],
48 [ 'one', 1 ],
49 [ 'other', 2 ],
50 [ 'other', 3 ],
51 ];
52 }
53}
Helping class to run tests using a clean language instance.
Tests for MediaWiki languages/classes/LanguageSe.php.
static providePlural()
testPlural( $result, $value)
providePlural Language::convertPlural
static providePluralTwoForms()
testPluralTwoForms( $result, $value)
providePluralTwoForms Language::convertPlural
testGetPluralRuleType( $result, $value)
providePlural Language::getPluralRuleType