Index: trunk/phase3/tests/phpunit/languages/LanguageArTest.php |
— | — | @@ -52,4 +52,27 @@ |
53 | 53 | ), |
54 | 54 | ); |
55 | 55 | } |
| 56 | + /** @dataProvider providePlural */ |
| 57 | + function testPlural( $result, $value ) { |
| 58 | + $forms = array( 'zero', 'one', 'two', 'few', 'many', 'other' ); |
| 59 | + $this->assertEquals( $result, $this->lang->convertPlural( $value, $forms ) ); |
| 60 | + } |
| 61 | + function providePlural() { |
| 62 | + return array ( |
| 63 | + array( 'zero', 0 ), |
| 64 | + array( 'one', 1 ), |
| 65 | + array( 'two', 2 ), |
| 66 | + array( 'few', 3 ), |
| 67 | + array( 'few', 9 ), |
| 68 | + array( 'few', 110 ), |
| 69 | + array( 'many', 11 ), |
| 70 | + array( 'many', 15 ), |
| 71 | + array( 'many', 99 ), |
| 72 | + array( 'many', 9999 ), |
| 73 | + array( 'other', 100 ), |
| 74 | + array( 'other', 102 ), |
| 75 | + array( 'other', 1000 ), |
| 76 | + array( 'other', 1.7 ), |
| 77 | + ); |
| 78 | + } |
56 | 79 | } |
Index: trunk/phase3/tests/phpunit/languages/LanguageBsTest.php |
— | — | @@ -0,0 +1,41 @@ |
| 2 | +<?php |
| 3 | +/** |
| 4 | + * @author Santhosh Thottingal |
| 5 | + * @copyright Copyright © 2012, Santhosh Thottingal |
| 6 | + * @file |
| 7 | + */ |
| 8 | + |
| 9 | +/** Tests for MediaWiki languages/LanguageBs.php */ |
| 10 | +class LanguageBsTest extends MediaWikiTestCase { |
| 11 | + private $lang; |
| 12 | + |
| 13 | + function setUp() { |
| 14 | + $this->lang = Language::factory( 'Bs' ); |
| 15 | + } |
| 16 | + function tearDown() { |
| 17 | + unset( $this->lang ); |
| 18 | + } |
| 19 | + |
| 20 | + /** @dataProvider providePlural */ |
| 21 | + function testPlural( $result, $value ) { |
| 22 | + $forms = array( 'one', 'few', 'many', 'other' ); |
| 23 | + $this->assertEquals( $result, $this->lang->convertPlural( $value, $forms ) ); |
| 24 | + } |
| 25 | + |
| 26 | + function providePlural() { |
| 27 | + return array ( |
| 28 | + array( 'many', 0 ), |
| 29 | + array( 'one', 1 ), |
| 30 | + array( 'few', 2 ), |
| 31 | + array( 'few', 4 ), |
| 32 | + array( 'many', 5 ), |
| 33 | + array( 'many', 11 ), |
| 34 | + array( 'many', 20 ), |
| 35 | + array( 'one', 21 ), |
| 36 | + array( 'few', 24 ), |
| 37 | + array( 'many', 25 ), |
| 38 | + array( 'many', 200 ), |
| 39 | + ); |
| 40 | + } |
| 41 | + |
| 42 | +} |
Property changes on: trunk/phase3/tests/phpunit/languages/LanguageBsTest.php |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 43 | + native |
Index: trunk/phase3/tests/phpunit/languages/LanguageBeTest.php |
— | — | @@ -0,0 +1,40 @@ |
| 2 | +<?php |
| 3 | +/** |
| 4 | + * @author Santhosh Thottingal |
| 5 | + * @copyright Copyright © 2012, Santhosh Thottingal |
| 6 | + * @file |
| 7 | + */ |
| 8 | + |
| 9 | +/** Tests for MediaWiki languages/LanguageBe.php */ |
| 10 | +class LanguageBeTest extends MediaWikiTestCase { |
| 11 | + private $lang; |
| 12 | + |
| 13 | + function setUp() { |
| 14 | + $this->lang = Language::factory( 'Be' ); |
| 15 | + } |
| 16 | + function tearDown() { |
| 17 | + unset( $this->lang ); |
| 18 | + } |
| 19 | + |
| 20 | + /** @dataProvider providePlural */ |
| 21 | + function testPlural( $result, $value ) { |
| 22 | + $forms = array( 'one', 'few', 'many', 'other' ); |
| 23 | + $this->assertEquals( $result, $this->lang->convertPlural( $value, $forms ) ); |
| 24 | + } |
| 25 | + |
| 26 | + function providePlural() { |
| 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 | +} |
Property changes on: trunk/phase3/tests/phpunit/languages/LanguageBeTest.php |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 42 | + native |
Index: trunk/phase3/tests/phpunit/languages/LanguageBhTest.php |
— | — | @@ -0,0 +1,34 @@ |
| 2 | +<?php |
| 3 | +/** |
| 4 | + * @author Santhosh Thottingal |
| 5 | + * @copyright Copyright © 2012, Santhosh Thottingal |
| 6 | + * @file |
| 7 | + */ |
| 8 | + |
| 9 | +/** Tests for MediaWiki languages/LanguageBh.php */ |
| 10 | +class LanguageBhTest extends MediaWikiTestCase { |
| 11 | + private $lang; |
| 12 | + |
| 13 | + function setUp() { |
| 14 | + $this->lang = Language::factory( 'Bh' ); |
| 15 | + } |
| 16 | + function tearDown() { |
| 17 | + unset( $this->lang ); |
| 18 | + } |
| 19 | + |
| 20 | + /** @dataProvider providePlural */ |
| 21 | + function testPlural( $result, $value ) { |
| 22 | + $forms = array( 'one', 'other' ); |
| 23 | + $this->assertEquals( $result, $this->lang->convertPlural( $value, $forms ) ); |
| 24 | + } |
| 25 | + |
| 26 | + function providePlural() { |
| 27 | + return array ( |
| 28 | + array( 'one', 0 ), |
| 29 | + array( 'one', 1 ), |
| 30 | + array( 'other', 2 ), |
| 31 | + array( 'other', 200 ), |
| 32 | + ); |
| 33 | + } |
| 34 | + |
| 35 | +} |
Property changes on: trunk/phase3/tests/phpunit/languages/LanguageBhTest.php |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 36 | + native |
Index: trunk/phase3/tests/phpunit/languages/LanguageBe_taraskTest.php |
— | — | @@ -27,4 +27,39 @@ |
28 | 28 | function testDoesNotCommafyFourDigitsNumber() { |
29 | 29 | $this->assertEquals( '1234', $this->lang->commafy( '1234' ) ); |
30 | 30 | } |
| 31 | + /** @dataProvider providePluralFourForms */ |
| 32 | + function testPluralFourForms( $result, $value ) { |
| 33 | + $forms = array( 'one', 'few', 'many', 'other' ); |
| 34 | + $this->assertEquals( $result, $this->lang->convertPlural( $value, $forms ) ); |
| 35 | + } |
| 36 | + |
| 37 | + function providePluralFourForms() { |
| 38 | + return array ( |
| 39 | + array( 'one', 1 ), |
| 40 | + array( 'many', 11 ), |
| 41 | + array( 'one', 91 ), |
| 42 | + array( 'one', 121 ), |
| 43 | + array( 'few', 2 ), |
| 44 | + array( 'few', 3 ), |
| 45 | + array( 'few', 4 ), |
| 46 | + array( 'few', 334 ), |
| 47 | + array( 'many', 5 ), |
| 48 | + array( 'many', 15 ), |
| 49 | + array( 'many', 120 ), |
| 50 | + ); |
| 51 | + } |
| 52 | + /** @dataProvider providePluralTwoForms */ |
| 53 | + function testPluralTwoForms( $result, $value ) { |
| 54 | + $forms = array( 'one', 'several' ); |
| 55 | + $this->assertEquals( $result, $this->lang->convertPlural( $value, $forms ) ); |
| 56 | + } |
| 57 | + function providePluralTwoForms() { |
| 58 | + return array ( |
| 59 | + array( 'one', 1 ), |
| 60 | + array( 'several', 11 ), |
| 61 | + array( 'several', 91 ), |
| 62 | + array( 'several', 121 ), |
| 63 | + ); |
| 64 | + } |
| 65 | + |
31 | 66 | } |
Index: trunk/phase3/tests/phpunit/languages/LanguageAmTest.php |
— | — | @@ -0,0 +1,33 @@ |
| 2 | +<?php |
| 3 | +/** |
| 4 | + * @author Santhosh Thottingal |
| 5 | + * @copyright Copyright © 2012, Santhosh Thottingal |
| 6 | + * @file |
| 7 | + */ |
| 8 | + |
| 9 | +/** Tests for MediaWiki languages/LanguageAm.php */ |
| 10 | +class LanguageAmTest extends MediaWikiTestCase { |
| 11 | + private $lang; |
| 12 | + |
| 13 | + function setUp() { |
| 14 | + $this->lang = Language::factory( 'Am' ); |
| 15 | + } |
| 16 | + function tearDown() { |
| 17 | + unset( $this->lang ); |
| 18 | + } |
| 19 | + |
| 20 | + /** @dataProvider providePlural */ |
| 21 | + function testPlural( $result, $value ) { |
| 22 | + $forms = array( 'one', 'other' ); |
| 23 | + $this->assertEquals( $result, $this->lang->convertPlural( $value, $forms ) ); |
| 24 | + } |
| 25 | + |
| 26 | + function providePlural() { |
| 27 | + return array ( |
| 28 | + array( 'one', 0 ), |
| 29 | + array( 'one', 1 ), |
| 30 | + array( 'other', 2 ), |
| 31 | + array( 'other', 200 ), |
| 32 | + ); |
| 33 | + } |
| 34 | +} |
Property changes on: trunk/phase3/tests/phpunit/languages/LanguageAmTest.php |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 35 | + native |
Index: trunk/phase3/tests/phpunit/languages/LanguageHiTest.php |
— | — | @@ -0,0 +1,34 @@ |
| 2 | +<?php |
| 3 | +/** |
| 4 | + * @author Santhosh Thottingal |
| 5 | + * @copyright Copyright © 2012, Santhosh Thottingal |
| 6 | + * @file |
| 7 | + */ |
| 8 | + |
| 9 | +/** Tests for MediaWiki languages/LanguageHi.php */ |
| 10 | +class LanguageHiTest extends MediaWikiTestCase { |
| 11 | + private $lang; |
| 12 | + |
| 13 | + function setUp() { |
| 14 | + $this->lang = Language::factory( 'Hi' ); |
| 15 | + } |
| 16 | + function tearDown() { |
| 17 | + unset( $this->lang ); |
| 18 | + } |
| 19 | + |
| 20 | + /** @dataProvider providePlural */ |
| 21 | + function testPlural( $result, $value ) { |
| 22 | + $forms = array( 'one', 'other' ); |
| 23 | + $this->assertEquals( $result, $this->lang->convertPlural( $value, $forms ) ); |
| 24 | + } |
| 25 | + |
| 26 | + function providePlural() { |
| 27 | + return array ( |
| 28 | + array( 'one', 0 ), |
| 29 | + array( 'one', 1 ), |
| 30 | + array( 'other', 2 ), |
| 31 | + array( 'other', 200 ), |
| 32 | + ); |
| 33 | + } |
| 34 | + |
| 35 | +} |
Property changes on: trunk/phase3/tests/phpunit/languages/LanguageHiTest.php |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 36 | + native |