summaryrefslogtreecommitdiff
path: root/_test/tests/inc/utf8_romanize.test.php
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2012-05-01 12:38:41 -0700
committerAndreas Gohr <andi@splitbrain.org>2012-05-01 12:38:41 -0700
commit3c0d44f1aa44d3ac3d8b9e652d172b1eda680bbf (patch)
tree5a9a42fb720a774c2bb8c393d3046d7beb11bf8f /_test/tests/inc/utf8_romanize.test.php
parente67fdd7b79e8f05b9e7e9164691114222e3c377c (diff)
parent1831d8a0f848f2e0dd5ef195791b6beaa5d1acb7 (diff)
downloadrpg-3c0d44f1aa44d3ac3d8b9e652d172b1eda680bbf.tar.gz
rpg-3c0d44f1aa44d3ac3d8b9e652d172b1eda680bbf.tar.bz2
Merge pull request #96 from dom-mel/phpunit
Replace SimpleTest with PHPUnit
Diffstat (limited to '_test/tests/inc/utf8_romanize.test.php')
-rw-r--r--_test/tests/inc/utf8_romanize.test.php37
1 files changed, 37 insertions, 0 deletions
diff --git a/_test/tests/inc/utf8_romanize.test.php b/_test/tests/inc/utf8_romanize.test.php
new file mode 100644
index 000000000..d08346faa
--- /dev/null
+++ b/_test/tests/inc/utf8_romanize.test.php
@@ -0,0 +1,37 @@
+<?php
+// use no mbstring help here
+if(!defined('UTF8_NOMBSTRING')) define('UTF8_NOMBSTRING',1);
+
+/**
+ * @group slow
+ */
+class utf8_romanize_test extends PHPUnit_Framework_TestCase {
+
+ /**
+ * Check Japanese romanization
+ *
+ * @author Denis Scheither <amorphis@uni-bremen.de>
+ */
+ function test_japanese(){
+ $tests = file(dirname(__FILE__).'/utf8_kanaromaji.txt');
+ $line = 1;
+ foreach($tests as $test){
+ list($jap,$rom) = explode(';',trim($test));
+
+ $chk = utf8_romanize($jap);
+ $this->assertEquals($rom,$chk,"$jap\t->\t$chk\t!=\t$rom\t($line)");
+ $line++;
+ }
+ }
+
+ /**
+ * Test romanization of character that would usually be deaccented in a different
+ * way FS#1117
+ *
+ * @author Andreas Gohr <andi@splitbrain.org>
+ */
+ function test_deaccented(){
+ $this->assertEquals("a A a A a o O",utf8_romanize("å Å ä Ä ä ö Ö"));
+ }
+}
+//Setup VIM: ex: et ts=4 :