MediaWiki REL1_30
LanguageMoTest.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 [ 'few', 0 ],
30 [ 'one', 1 ],
31 [ 'few', 2 ],
32 [ 'few', 19 ],
33 [ 'other', 20 ],
34 [ 'other', 99 ],
35 [ 'other', 100 ],
36 [ 'few', 101 ],
37 [ 'few', 119 ],
38 [ 'other', 120 ],
39 [ 'other', 200 ],
40 [ 'few', 201 ],
41 [ 'few', 219 ],
42 [ 'other', 220 ],
43 ];
44 }
45}
Helping class to run tests using a clean language instance.
Tests for MediaWiki languages/classes/LanguageMo.php.
testPlural( $result, $value)
providePlural Language::convertPlural
testGetPluralRuleType( $result, $value)
providePlural Language::getPluralRuleType
static providePlural()