MediaWiki  REL1_19
LanguageMtTest.php
Go to the documentation of this file.
00001 <?php
00009 class LanguageMtTest extends MediaWikiTestCase {
00010         private $lang;
00011 
00012         function setUp() {
00013                 $this->lang = Language::factory( 'mt' );
00014         }
00015         function tearDown() {
00016                 unset( $this->lang );
00017         }
00018 
00020         function testPluralAllForms( $result, $value ) {
00021                 $forms = array( 'one', 'few', 'many', 'other' );
00022                 $this->assertEquals( $result, $this->lang->convertPlural( $value, $forms ) );
00023         }
00024 
00025         function providerPluralAllForms() {
00026                 return array (
00027                         array( 'few',   0 ),
00028                         array( 'one',   1 ),
00029                         array( 'few',   2 ),
00030                         array( 'few',   10 ),
00031                         array( 'many',  11 ),
00032                         array( 'many',  19 ),
00033                         array( 'other', 20 ),
00034                         array( 'other', 99 ),
00035                         array( 'other', 100 ),
00036                         array( 'other', 101 ),
00037                         array( 'few',   102 ),
00038                         array( 'few',   110 ),
00039                         array( 'many',  111 ),
00040                         array( 'many',  119 ),
00041                         array( 'other', 120 ),
00042                         array( 'other', 201 ),
00043                 );
00044         }
00045 
00047         function testPluralTwoForms( $result, $value ) {
00048                 $forms = array( 'one', 'many' );
00049                 $this->assertEquals( $result, $this->lang->convertPlural( $value, $forms ) );
00050         }
00051 
00052         function providerPluralTwoForms() {
00053                 return array (
00054                         array( 'many',  0 ),
00055                         array( 'one',   1 ),
00056                         array( 'many',  2 ),
00057                         array( 'many',  10 ),
00058                         array( 'many',  11 ),
00059                         array( 'many',  19 ),
00060                         array( 'many',  20 ),
00061                         array( 'many',  99 ),
00062                         array( 'many',  100 ),
00063                         array( 'many',  101 ),
00064                         array( 'many',  102 ),
00065                         array( 'many',  110 ),
00066                         array( 'many',  111 ),
00067                         array( 'many',  119 ),
00068                         array( 'many',  120 ),
00069                         array( 'many',  201 ),
00070                 );
00071         }
00072 }