r110390 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r110389‎ | r110390 | r110391 >
Date:14:42, 31 January 2012
Author:amire80
Status:ok
Tags:
Comment:
Testing the case when dual is not provided.
Modified paths:
  • /trunk/phase3/tests/phpunit/languages/LanguageHeTest.php (modified) (history)

Diff [purge]

Index: trunk/phase3/tests/phpunit/languages/LanguageHeTest.php
@@ -16,17 +16,32 @@
1717 unset( $this->lang );
1818 }
1919
 20+ /** @dataProvider providerPluralDual */
 21+ function testPluralDual( $result, $value ) {
 22+ $forms = array( 'one', 'many', 'two' );
 23+ $this->assertEquals( $result, $this->lang->convertPlural( $value, $forms ) );
 24+ }
 25+
 26+ function providerPluralDual() {
 27+ return array (
 28+ array( 'many', 0 ), // Zero -> plural
 29+ array( 'one', 1 ), // Singular
 30+ array( 'two', 2 ), // Dual
 31+ array( 'many', 3 ), // Plural
 32+ );
 33+ }
 34+
2035 /** @dataProvider providerPlural */
2136 function testPlural( $result, $value ) {
22 - $forms = array( 'one', 'many', 'two' );
 37+ $forms = array( 'one', 'many' );
2338 $this->assertEquals( $result, $this->lang->convertPlural( $value, $forms ) );
2439 }
2540
2641 function providerPlural() {
2742 return array (
28 - array( 'many', 0 ), // Zero
 43+ array( 'many', 0 ), // Zero -> plural
2944 array( 'one', 1 ), // Singular
30 - array( 'two', 2 ), // Dual
 45+ array( 'many', 2 ), // Plural, no dual provided
3146 array( 'many', 3 ), // Plural
3247 );
3348 }

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r110386Adding tests for plural in Hebrew.amire8013:49, 31 January 2012

Status & tagging log