3 * @version $Id: utf8_ucfirst.test.php,v 1.3 2006/02/26 13:07:42 harryf Exp $
8 //--------------------------------------------------------------------
14 require_once(dirname(__FILE__).'/../config.php');
15 require_once UTF8 . '/ucfirst.php';
17 //--------------------------------------------------------------------
22 class test_utf8_ucfirst extends UnitTestCase {
24 function test_utf8_ucfirst() {
25 $this->UnitTestCase('test_utf8_ucfirst()');
28 function testUcfirst() {
29 $str = 'ñtërnâtiônàlizætiøn';
30 $ucfirst = 'Ñtërnâtiônàlizætiøn';
31 $this->assertEqual(utf8_ucfirst($str),$ucfirst);
34 function testUcfirstSpace() {
35 $str = ' iñtërnâtiônàlizætiøn';
36 $ucfirst = ' iñtërnâtiônàlizætiøn';
37 $this->assertEqual(utf8_ucfirst($str),$ucfirst);
40 function testUcfirstUpper() {
41 $str = 'Ñtërnâtiônàlizætiøn';
42 $ucfirst = 'Ñtërnâtiônàlizætiøn';
43 $this->assertEqual(utf8_ucfirst($str),$ucfirst);
46 function testEmptyString() {
48 $this->assertEqual(utf8_ucfirst($str),'');
51 function testOneChar() {
54 $this->assertEqual(utf8_ucfirst($str),$ucfirst);
57 function testLinefeed() {
58 $str = "ñtërn\nâtiônàlizætiøn";
59 $ucfirst = "Ñtërn\nâtiônàlizætiøn";
60 $this->assertEqual(utf8_ucfirst($str),$ucfirst);
65 //--------------------------------------------------------------------
70 if (!defined('TEST_RUNNING')) {
71 define('TEST_RUNNING', true);
72 $test = &new test_utf8_ucfirst();
73 $reporter = & getTestReporter();
74 $test->run($reporter);