3 * @version $Id: utf8_ord.test.php,v 1.1 2006/03/26 22:26:16 harryf Exp $
8 //--------------------------------------------------------------------
14 require_once(dirname(__FILE__).'/../config.php');
15 require_once UTF8 . '/ord.php';
17 //--------------------------------------------------------------------
22 class test_utf8_ord extends UnitTestCase {
24 function test_utf8_ord() {
25 $this->UnitTestCase('utf8_ord()');
28 function testEmptyStr() {
30 $this->assertEqual(utf8_ord($str),0);
33 function testAsciiChar() {
35 $this->assertEqual(utf8_ord($str),97);
38 function test2ByteChar() {
40 $this->assertEqual(utf8_ord($str),241);
43 function test3ByteChar() {
45 $this->assertEqual(utf8_ord($str),8359);
48 function test4ByteChar() {
49 $str = "\xf0\x90\x8c\xbc";
50 $this->assertEqual(utf8_ord($str),66364);
55 //--------------------------------------------------------------------
60 if (!defined('TEST_RUNNING')) {
61 define('TEST_RUNNING', true);
62 $test = &new test_utf8_ord();
63 $reporter = & getTestReporter();
64 $test->run($reporter);