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