Clean and repair many phpunit tests (+ fix implied configuration)
[lhc/web/wiklou.git] / tests / phpunit / languages / LanguageUkTest.php
1 <?php
2 /**
3 * @author Amir E. Aharoni
4 * based on LanguageBe_tarask.php
5 * @copyright Copyright © 2012, Amir E. Aharoni
6 * @file
7 */
8
9 /** Tests for MediaWiki languages/classes/LanguageUk.php */
10 class LanguageUkTest extends MediaWikiTestCase {
11 private $lang;
12
13 protected function setUp() {
14 $this->lang = Language::factory( 'Uk' );
15 }
16 protected function tearDown() {
17 unset( $this->lang );
18 }
19
20 /** @dataProvider providePluralFourForms */
21 function testPluralFourForms( $result, $value ) {
22 $forms = array( 'one', 'few', 'many', 'other' );
23 $this->assertEquals( $result, $this->lang->convertPlural( $value, $forms ) );
24 }
25
26 function providePluralFourForms() {
27 return array (
28 array( 'one', 1 ),
29 array( 'many', 11 ),
30 array( 'one', 91 ),
31 array( 'one', 121 ),
32 array( 'few', 2 ),
33 array( 'few', 3 ),
34 array( 'few', 4 ),
35 array( 'few', 334 ),
36 array( 'many', 5 ),
37 array( 'many', 15 ),
38 array( 'many', 120 ),
39 );
40 }
41 /** @dataProvider providePluralTwoForms */
42 function testPluralTwoForms( $result, $value ) {
43 $forms = array( 'one', 'several' );
44 $this->assertEquals( $result, $this->lang->convertPlural( $value, $forms ) );
45 }
46 function providePluralTwoForms() {
47 return array (
48 array( 'one', 1 ),
49 array( 'several', 11 ),
50 array( 'several', 91 ),
51 array( 'several', 121 ),
52 );
53 }
54 }