r110386 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r110385‎ | r110386 | r110387 >
Date:13:49, 31 January 2012
Author:amire80
Status:ok
Tags:
Comment:
Adding tests for plural in Hebrew.
Modified paths:
  • /trunk/phase3/tests/phpunit/languages/LanguageHeTest.php (added) (history)

Diff [purge]

Index: trunk/phase3/tests/phpunit/languages/LanguageHeTest.php
@@ -0,0 +1,33 @@
 2+<?php
 3+/**
 4+ * @author Amir E. Aharoni
 5+ * @copyright Copyright © 2012, Amir E. Aharoni
 6+ * @file
 7+ */
 8+
 9+/** Tests for MediaWiki languages/classes/LanguageHe.php */
 10+class LanguageHeTest extends MediaWikiTestCase {
 11+ private $lang;
 12+
 13+ function setUp() {
 14+ $this->lang = Language::factory( 'he' );
 15+ }
 16+ function tearDown() {
 17+ unset( $this->lang );
 18+ }
 19+
 20+ /** @dataProvider providerPlural */
 21+ function testPlural( $result, $value ) {
 22+ $forms = array( 'one', 'many', 'two' );
 23+ $this->assertEquals( $result, $this->lang->convertPlural( $value, $forms ) );
 24+ }
 25+
 26+ function providerPlural() {
 27+ return array (
 28+ array( 'many', 0 ), // Zero
 29+ array( 'one', 1 ), // Singular
 30+ array( 'two', 2 ), // Dual
 31+ array( 'many', 3 ), // Plural
 32+ );
 33+ }
 34+}
Property changes on: trunk/phase3/tests/phpunit/languages/LanguageHeTest.php
___________________________________________________________________
Added: svn:eol-style
135 + native

Follow-up revisions

RevisionCommit summaryAuthorDate
r110390Testing the case when dual is not provided.amire8014:42, 31 January 2012

Status & tagging log