X-Git-Url: https://projects.mako.cc/source/scuttle/blobdiff_plain/bce919af7b49bbd06223f79b8c37a53a3d263ff0..c7f63c8b9b12efd7b3c10b9f80cda06eaf32068f:/includes/utf8/tests/cases/utf8_ucwords.test.php diff --git a/includes/utf8/tests/cases/utf8_ucwords.test.php b/includes/utf8/tests/cases/utf8_ucwords.test.php new file mode 100644 index 0000000..6e8b57c --- /dev/null +++ b/includes/utf8/tests/cases/utf8_ucwords.test.php @@ -0,0 +1,76 @@ +UnitTestCase('test_utf8_ucwords ()'); + } + + function testUcword() { + $str = 'iñtërnâtiônàlizætiøn'; + $ucwords = 'Iñtërnâtiônàlizætiøn'; + $this->assertEqual(utf8_ucwords($str),$ucwords); + } + + function testUcwords() { + $str = 'iñt ërn âti ônà liz æti øn'; + $ucwords = 'Iñt Ërn Âti Ônà Liz Æti Øn'; + $this->assertEqual(utf8_ucwords($str),$ucwords); + } + + function testUcwordsNewline() { + $str = "iñt ërn âti\n ônà liz æti øn"; + $ucwords = "Iñt Ërn Âti\n Ônà Liz Æti Øn"; + $this->assertEqual(utf8_ucwords($str),$ucwords); + } + + function testEmptyString() { + $str = ''; + $ucwords = ''; + $this->assertEqual(utf8_ucwords($str),$ucwords); + } + + function testOneChar() { + $str = 'ñ'; + $ucwords = 'Ñ'; + $this->assertEqual(utf8_ucwords($str),$ucwords); + } + + function testLinefeed() { + $str = "iñt ërn âti\n ônà liz æti øn"; + $ucwords = "Iñt Ërn Âti\n Ônà Liz Æti Øn"; + $this->assertEqual(utf8_ucwords($str),$ucwords); + } + +} + +//-------------------------------------------------------------------- +/** +* @package utf8 +* @subpackage Tests +*/ +if (!defined('TEST_RUNNING')) { + define('TEST_RUNNING', true); + $test = &new test_utf8_ucwords (); + $reporter = & getTestReporter(); + $test->run($reporter); +}