xref: /dokuwiki/_test/tests/inc/utf8_romanize.test.php (revision ead851a84b96ca8b022e8980362b248ec2712dfa)
1<?php
2// use no mbstring help here
3if(!defined('UTF8_NOMBSTRING')) define('UTF8_NOMBSTRING',1);
4
5/**
6 * @group slow
7 */
8class utf8_romanize_test extends DokuWikiTest {
9
10    /**
11     * Check Japanese romanization
12     *
13     * @author Denis Scheither <amorphis@uni-bremen.de>
14     */
15    function test_japanese(){
16        $tests = file(dirname(__FILE__).'/utf8_kanaromaji.txt');
17        $line = 1;
18        foreach($tests as $test){
19            list($jap,$rom) = explode(';',trim($test));
20
21            $chk = utf8_romanize($jap);
22            $this->assertEquals($rom,$chk,"$jap\t->\t$chk\t!=\t$rom\t($line)");
23            $line++;
24        }
25    }
26
27    /**
28     * Test romanization of character that would usually be deaccented in a different
29     * way FS#1117
30     *
31     * @author Andreas Gohr <andi@splitbrain.org>
32     */
33    function test_deaccented(){
34        $this->assertEquals("a A a A a o O",utf8_romanize("å Å ä Ä ä ö Ö"));
35    }
36}
37//Setup VIM: ex: et ts=4 :
38