3 * @version $Id: utf8_strcasecmp.test.php,v 1.2 2006/02/25 14:52:18 harryf Exp $
8 //--------------------------------------------------------------------
14 require_once(dirname(__FILE__).'/../config.php');
15 require_once UTF8 . '/strcasecmp.php';
17 //--------------------------------------------------------------------
22 class test_utf8_strcasecmp extends UnitTestCase {
24 function test_utf8_strcasecmp () {
25 $this->UnitTestCase('test_utf8_strcasecmp()');
28 function testCompareEqual() {
29 $strX = 'iñtërnâtiônàlizætiøn';
30 $strY = 'IÑTËRNÂTIÔNÀLIZÆTIØN';
31 $this->assertEqual(utf8_strcasecmp($strX,$strY),0);
36 $strX = 'iñtërnâtiônàlizætiøn';
37 $strY = 'IÑTËRNÂTIÔÀLIZÆTIØN';
38 $this->assertTrue(utf8_strcasecmp($strX,$strY) < 0);
41 function testGreater() {
42 $strX = 'iñtërnâtiôàlizætiøn';
43 $strY = 'IÑTËRNÂTIÔNÀLIZÆTIØN';
44 $this->assertTrue(utf8_strcasecmp($strX,$strY) > 0);
47 function testEmptyX() {
49 $strY = 'IÑTËRNÂTIÔNÀLIZÆTIØN';
50 $this->assertTrue(utf8_strcasecmp($strX,$strY) < 0);
53 function testEmptyY() {
54 $strX = 'iñtërnâtiôàlizætiøn';
56 $this->assertTrue(utf8_strcasecmp($strX,$strY) > 0);
59 function testEmptyBoth() {
62 $this->assertTrue(utf8_strcasecmp($strX,$strY) == 0);
65 function testLinefeed() {
66 $strX = "iñtërnâtiôn\nàlizætiøn";
67 $strY = "IÑTËRNÂTIÔN\nÀLIZÆTIØN";
68 $this->assertTrue(utf8_strcasecmp($strX,$strY) == 0);
73 //--------------------------------------------------------------------
78 if (!defined('TEST_RUNNING')) {
79 define('TEST_RUNNING', true);
80 $test = &new test_utf8_strcasecmp ();
81 $reporter = & getTestReporter();
82 $test->run($reporter);