Index: trunk/phase3/maintenance/tests/phpunit/includes/LanguageConverterTest.php |
— | — | @@ -11,7 +11,7 @@ |
12 | 12 | $wgRequest = new FauxRequest( array() ); |
13 | 13 | $wgMemc = new FakeMemCachedClient; |
14 | 14 | $wgContLang = Language::factory( 'tg' ); |
15 | | - $this->lang = new LanguageTest(); |
| 15 | + $this->lang = new LanguageToTest(); |
16 | 16 | $this->lc = new TestConverter( $this->lang, 'tg', |
17 | 17 | array( 'tg', 'tg-latn' ) ); |
18 | 18 | } |
— | — | @@ -119,7 +119,7 @@ |
120 | 120 | |
121 | 121 | } |
122 | 122 | |
123 | | -class LanguageTest extends Language { |
| 123 | +class LanguageToTest extends Language { |
124 | 124 | function __construct() { |
125 | 125 | parent::__construct(); |
126 | 126 | $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 | +} |