r76240 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r76239‎ | r76240 | r76241 >
Date:11:30, 7 November 2010
Author:hashar
Status:deferred
Tags:
Comment:
Test for Language::convertDoubleWidth (followup r64088 and r63776)
Modified paths:
  • /trunk/phase3/maintenance/tests/phpunit/includes/LanguageConverterTest.php (modified) (history)
  • /trunk/phase3/maintenance/tests/phpunit/languages/LanguageTest.php (added) (history)

Diff [purge]

Index: trunk/phase3/maintenance/tests/phpunit/includes/LanguageConverterTest.php
@@ -11,7 +11,7 @@
1212 $wgRequest = new FauxRequest( array() );
1313 $wgMemc = new FakeMemCachedClient;
1414 $wgContLang = Language::factory( 'tg' );
15 - $this->lang = new LanguageTest();
 15+ $this->lang = new LanguageToTest();
1616 $this->lc = new TestConverter( $this->lang, 'tg',
1717 array( 'tg', 'tg-latn' ) );
1818 }
@@ -119,7 +119,7 @@
120120
121121 }
122122
123 -class LanguageTest extends Language {
 123+class LanguageToTest extends Language {
124124 function __construct() {
125125 parent::__construct();
126126 $variants = array( 'tg', 'tg-latn' );
Index: trunk/phase3/maintenance/tests/phpunit/languages/LanguageTest.php
@@ -0,0 +1,23 @@
 2+<?php
 3+require_once dirname(dirname(__FILE__)). '/bootstrap.php';
 4+
 5+class LanguageTest extends MediaWikiTestSetup {
 6+ private $lang;
 7+
 8+ function setUp() {
 9+ $this->lang = Language::factory( 'en' );
 10+ }
 11+ function tearDown() {
 12+ unset( $this->lang );
 13+ }
 14+
 15+ function testLanguageConvertDoubleWidthToSingleWidth() {
 16+ $this->assertEquals(
 17+ "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",
 18+ $this->lang->normalizeForSearch(
 19+ "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
 20+ ),
 21+ 'convertDoubleWidth() with the full alphabet and digits'
 22+ );
 23+ }
 24+}

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r63776off-by-one error: the fullwidth z was not being converted.mah17:31, 15 March 2010
r64088* Implement normalization of fullwidth latin characters for all Languages, no...mah19:50, 23 March 2010

Status & tagging log