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