MediaWiki REL1_32
LanguageHsbTest.php
Go to the documentation of this file.
1<?php
16 public function testPlural( $result, $value ) {
17 $forms = [ 'one', 'two', 'few', 'other' ];
18 $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
19 }
20
25 public function testGetPluralRuleType( $result, $value ) {
26 $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) );
27 }
28
29 public static function providePlural() {
30 return [
31 [ 'other', 0 ],
32 [ 'one', 1 ],
33 [ 'one', 101 ],
34 [ 'one', 90001 ],
35 [ 'two', 2 ],
36 [ 'few', 3 ],
37 [ 'few', 203 ],
38 [ 'few', 4 ],
39 [ 'other', 99 ],
40 [ 'other', 555 ],
41 ];
42 }
43}
Helping class to run tests using a clean language instance.
testPlural( $result, $value)
providePlural Language::convertPlural
testGetPluralRuleType( $result, $value)
providePlural Language::getPluralRuleType