summaryrefslogtreecommitdiff
path: root/www/wiki/tests/phpunit/languages/classes/LanguageLvTest.php
blob: 9827c68b014b54f356338d1fdd92df289ab88039 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?php
/**
 * @author Santhosh Thottingal
 * @copyright Copyright © 2012, Santhosh Thottingal
 * @file
 */

/** Tests for Latvian */
class LanguageLvTest extends LanguageClassesTestCase {
	/**
	 * @dataProvider providePlural
	 * @covers Language::convertPlural
	 */
	public function testPlural( $result, $value ) {
		$forms = [ 'zero', 'one', 'other' ];
		$this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
	}

	/**
	 * @dataProvider providePlural
	 * @covers Language::getPluralRuleType
	 */
	public function testGetPluralRuleType( $result, $value ) {
		$this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) );
	}

	public static function providePlural() {
		return [
			[ 'zero', 0 ],
			[ 'one', 1 ],
			[ 'zero', 11 ],
			[ 'one', 21 ],
			[ 'zero', 411 ],
			[ 'other', 2 ],
			[ 'other', 9 ],
			[ 'zero', 12 ],
			[ 'other', 12.345 ],
			[ 'zero', 20 ],
			[ 'other', 22 ],
			[ 'one', 31 ],
			[ 'zero', 200 ],
		];
	}
}