Move Test files under same folder structure where class is (/languages/)
[lhc/web/wiklou.git] / tests / phpunit / languages / classes / LanguageSmaTest.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/LanguageSma.php */
9 class LanguageSmaTest extends LanguageClassesTestCase {
10 /**
11 * @dataProvider providePlural
12 * @covers Language::convertPlural
13 */
14 public function testPlural( $result, $value ) {
15 $forms = array( 'one', 'two', 'other' );
16 $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
17 }
18
19 /**
20 * @dataProvider providePlural
21 * @covers Language::getPluralRuleType
22 */
23 public function testGetPluralRuleType( $result, $value ) {
24 $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) );
25 }
26
27 public static function providePlural() {
28 return array(
29 array( 'other', 0 ),
30 array( 'one', 1 ),
31 array( 'two', 2 ),
32 array( 'other', 3 ),
33 );
34 }
35
36 /**
37 * @dataProvider providePluralTwoForms
38 * @covers Language::convertPlural
39 */
40 public function testPluralTwoForms( $result, $value ) {
41 $forms = array( 'one', 'other' );
42 $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
43 }
44
45 public static function providePluralTwoForms() {
46 return array(
47 array( 'other', 0 ),
48 array( 'one', 1 ),
49 array( 'other', 2 ),
50 array( 'other', 3 ),
51 );
52 }
53 }