3 * @version $Id: utf8_unicode.test.php,v 1.1 2006/10/17 09:58:29 harryf Exp $
8 //--------------------------------------------------------------------
14 require_once(dirname(__FILE__).'/../config.php');
15 require_once UTF8 . '/utils/unicode.php';
17 //--------------------------------------------------------------------
22 class test_utf8_to_unicode extends UnitTestCase {
24 function test_utf8_to_unicode() {
25 $this->UnitTestCase('test_utf8_to_unicode()');
28 function testEmptyString() {
29 $this->assertEqual(utf8_to_unicode(''),array());
32 function testString() {
56 $this->assertEqual(utf8_to_unicode('Iñtërnâtiônàlizætiøn'), $unicode);
61 //--------------------------------------------------------------------
66 class test_utf8_from_unicode extends UnitTestCase {
68 function test_utf8_strip_specials() {
69 $this->UnitTestCase('test_utf8_strip_specials()');
72 function testEmptyArray() {
73 $this->assertEqual(utf8_from_unicode(array()),'');
76 function testArray() {
100 $this->assertEqual(utf8_from_unicode($unicode), 'Iñtërnâtiônàlizætiøn');
105 //--------------------------------------------------------------------
110 if (!defined('TEST_RUNNING')) {
111 define('TEST_RUNNING', true);
112 $test = &new GroupTest('utf8_ascii');
113 $test->addTestCase(new test_utf8_to_unicode());
114 $test->addTestCase(new test_utf8_from_unicode());
115 $reporter = & getTestReporter();
116 $test->run($reporter);