[ Index ]

PHP Cross Reference of DokuWiki

title

Body

[close]

/_test/cases/inc/ -> utf8_romanize.test.php (source)

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


Generated: Wed Dec 3 01:30:02 2008 Cross-referenced by PHPXref 0.7