3 * @version $Id: utf8_stristr.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 . '/stristr.php';
17 //--------------------------------------------------------------------
22 class test_utf8_stristr extends UnitTestCase {
24 function test_utf8_stristr () {
25 $this->UnitTestCase('test_utf8_stristr()');
28 function testSubstr() {
29 $str = 'iñtërnâtiônàlizætiøn';
31 $this->assertEqual(utf8_stristr($str,$search),'nâtiônàlizætiøn');
34 function testSubstrNoMatch() {
35 $str = 'iñtërnâtiônàlizætiøn';
37 $this->assertFalse(utf8_stristr($str,$search));
40 function testEmptySearch() {
41 $str = 'iñtërnâtiônàlizætiøn';
43 $this->assertEqual(utf8_stristr($str,$search),'iñtërnâtiônàlizætiøn');
46 function testEmptyStr() {
49 $this->assertFalse(utf8_stristr($str,$search));
52 function testEmptyBoth() {
55 $this->assertEqual(utf8_stristr($str,$search),'');
58 function testLinefeedStr() {
59 $str = "iñt\nërnâtiônàlizætiøn";
61 $this->assertEqual(utf8_stristr($str,$search),'nâtiônàlizætiøn');
64 function testLinefeedBoth() {
65 $str = "iñtërn\nâtiônàlizætiøn";
67 $this->assertEqual(utf8_stristr($str,$search),"n\nâtiônàlizætiøn");
71 //--------------------------------------------------------------------
76 if (!defined('TEST_RUNNING')) {
77 define('TEST_RUNNING', true);
78 $test = &new test_utf8_stristr ();
79 $reporter = & getTestReporter();
80 $test->run($reporter);