3 * @version $Id: utf8_strlen.test.php,v 1.2 2006/02/24 23:33:10 harryf Exp $
8 //--------------------------------------------------------------------
14 require_once(dirname(__FILE__).'/../config.php');
16 //--------------------------------------------------------------------
21 class test_utf8_strlen extends UnitTestCase {
23 function test_utf8_strlen() {
24 $this->UnitTestCase('utf8_strlen()');
28 $str = 'Iñtërnâtiônàlizætiøn';
29 $this->assertEqual(utf8_strlen($str),20);
32 function testUtf8Invalid() {
33 $str = "Iñtërnâtiôn\xe9àlizætiøn";
34 $this->assertEqual(utf8_strlen($str),20);
37 function testAscii() {
39 $this->assertEqual(utf8_strlen($str),7);
42 function testEmptyStr() {
44 $this->assertEqual(utf8_strlen($str),0);
50 //--------------------------------------------------------------------
55 if (!defined('TEST_RUNNING')) {
56 define('TEST_RUNNING', true);
57 $test = &new test_utf8_strlen();
58 $reporter = & getTestReporter();
59 $test->run($reporter);