MediaWiki REL1_32
LanguageSgsTest.php
Go to the documentation of this file.
1<?php
14 public function testPluralAllForms( $result, $value ) {
15 $forms = [ 'one', 'two', '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 providePluralAllForms() {
28 return [
29 [ 'few', 0 ],
30 [ 'one', 1 ],
31 [ 'two', 2 ],
32 [ 'other', 3 ],
33 [ 'few', 10 ],
34 [ 'few', 11 ],
35 [ 'few', 12 ],
36 [ 'few', 19 ],
37 [ 'other', 20 ],
38 [ 'few', 100 ],
39 [ 'one', 101 ],
40 [ 'few', 111 ],
41 [ 'few', 112 ],
42 ];
43 }
44
49 public function testPluralTwoForms( $result, $value ) {
50 $forms = [ 'one', 'other' ];
51 $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
52 }
53
54 public static function providePluralTwoForms() {
55 return [
56 [ 'other', 0 ],
57 [ 'one', 1 ],
58 [ 'other', 2 ],
59 [ 'other', 3 ],
60 [ 'other', 10 ],
61 [ 'other', 11 ],
62 [ 'other', 12 ],
63 [ 'other', 19 ],
64 [ 'other', 20 ],
65 [ 'other', 100 ],
66 [ 'one', 101 ],
67 [ 'other', 111 ],
68 [ 'other', 112 ],
69 ];
70 }
71}
Helping class to run tests using a clean language instance.
Tests for Samogitian.
static providePluralAllForms()
testPluralTwoForms( $result, $value)
providePluralTwoForms Language::convertPlural
testPluralAllForms( $result, $value)
providePluralAllForms Language::convertPlural
static providePluralTwoForms()
testGetPluralRuleType( $result, $value)
providePluralAllForms Language::getPluralRuleType