Merge changes I9d2b148e,Iccf6ea81
[lhc/web/wiklou.git] / tests / phpunit / languages / LanguageRoTest.php
1 <?php
2 /**
3 * @author Amir E. Aharoni
4 * @copyright Copyright © 2012, Amir E. Aharoni
5 * @file
6 */
7
8 /** Tests for MediaWiki languages/classes/LanguageRo.php */
9 class LanguageRoTest extends MediaWikiTestCase {
10 private $lang;
11
12 protected function setUp() {
13 $this->lang = Language::factory( 'ro' );
14 }
15 protected function tearDown() {
16 unset( $this->lang );
17 }
18
19 /** @dataProvider providerPlural */
20 function testPlural( $result, $value ) {
21 $forms = array( 'one', 'few', 'other' );
22 $this->assertEquals( $result, $this->lang->convertPlural( $value, $forms ) );
23 }
24
25 function providerPlural() {
26 return array (
27 array( 'few', 0 ),
28 array( 'one', 1 ),
29 array( 'few', 2 ),
30 array( 'few', 19 ),
31 array( 'other', 20 ),
32 array( 'other', 99 ),
33 array( 'other', 100 ),
34 array( 'few', 101 ),
35 array( 'few', 119 ),
36 array( 'other', 120 ),
37 array( 'other', 200 ),
38 array( 'few', 201 ),
39 array( 'few', 219 ),
40 array( 'other', 220 ),
41 );
42 }
43 }