MediaWiki REL1_33
LanguageLtTest.php
Go to the documentation of this file.
1<?php
14 public function testPlural( $result, $value ) {
15 $forms = [ 'one', 'few', '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 [ '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 ],
40 ];
41 }
42
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 ) );
51 }
52
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 ],
61 ];
62 }
63}
and that you know you can do these things To protect your we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights These restrictions translate to certain responsibilities for you if you distribute copies of the or if you modify it For if you distribute copies of such a whether gratis or for a you must give the recipients all the rights that you have You must make sure that receive or can get the source code And you must show them these terms so they know their rights We protect your rights with two and(2) offer you this license which gives you legal permission to copy
Helping class to run tests using a clean language instance.
Tests for MediaWiki languages/LanguageLt.php.
testPlural( $result, $value)
providePlural Language::convertPlural
testOneFewPlural( $result, $value)
providePluralTwoForms Language::convertPlural
static providePlural()
static providePluralTwoForms()
testGetPluralRuleType( $result, $value)
providePlural Language::getPluralRuleType