3 * @version $Id: utf8_ucwords.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 . '/ucwords.php';
17 //--------------------------------------------------------------------
22 class test_utf8_ucwords extends UnitTestCase {
24 function test_utf8_ucwords () {
25 $this->UnitTestCase('test_utf8_ucwords ()');
28 function testUcword() {
29 $str = 'iñtërnâtiônàlizætiøn';
30 $ucwords = 'Iñtërnâtiônàlizætiøn';
31 $this->assertEqual(utf8_ucwords($str),$ucwords);
34 function testUcwords() {
35 $str = 'iñt ërn âti ônà liz æti øn';
36 $ucwords = 'Iñt Ërn Âti Ônà Liz Æti Øn';
37 $this->assertEqual(utf8_ucwords($str),$ucwords);
40 function testUcwordsNewline() {
41 $str = "iñt ërn âti\n ônà liz æti øn";
42 $ucwords = "Iñt Ërn Âti\n Ônà Liz Æti Øn";
43 $this->assertEqual(utf8_ucwords($str),$ucwords);
46 function testEmptyString() {
49 $this->assertEqual(utf8_ucwords($str),$ucwords);
52 function testOneChar() {
55 $this->assertEqual(utf8_ucwords($str),$ucwords);
58 function testLinefeed() {
59 $str = "iñt ërn âti\n ônà liz æti øn";
60 $ucwords = "Iñt Ërn Âti\n Ônà Liz Æti Øn";
61 $this->assertEqual(utf8_ucwords($str),$ucwords);
66 //--------------------------------------------------------------------
71 if (!defined('TEST_RUNNING')) {
72 define('TEST_RUNNING', true);
73 $test = &new test_utf8_ucwords ();
74 $reporter = & getTestReporter();
75 $test->run($reporter);