3 * @version $Id: utf8_strrpos.test.php,v 1.3 2006/02/24 23:33:10 harryf Exp $
8 //--------------------------------------------------------------------
14 require_once(dirname(__FILE__).'/../config.php');
16 //--------------------------------------------------------------------
21 class test_utf8_strrpos extends UnitTestCase {
23 function test_utf8_strrpos() {
24 $this->UnitTestCase('utf8_strrpos()');
28 $str = 'Iñtërnâtiônàlizætiøn';
29 $this->assertEqual(utf8_strrpos($str,'i'),17);
32 function testUtf8Offset() {
33 $str = 'Iñtërnâtiônàlizætiøn';
34 $this->assertEqual(utf8_strrpos($str,'n',11),19);
37 function testUtf8Invalid() {
38 $str = "Iñtërnâtiôn\xe9àlizætiøn";
39 $this->assertEqual(utf8_strrpos($str,'æ'),15);
42 function testAscii() {
44 $this->assertEqual(utf8_strrpos($str,'B'),5);
47 function testVsStrpos() {
49 $this->assertEqual(utf8_strrpos($str,'B'),strrpos($str,'B'));
52 function testEmptyStr() {
54 $this->assertFalse(utf8_strrpos($str,'x'));
57 function testLinefeed() {
58 $str = "Iñtërnâtiônàlizætiø\nn";
59 $this->assertEqual(utf8_strrpos($str,'i'),17);
62 function testLinefeedSearch() {
63 $str = "Iñtërnâtiônàlizætiø\nn";
64 $this->assertEqual(utf8_strrpos($str,"\n"),19);
68 //--------------------------------------------------------------------
73 if (!defined('TEST_RUNNING')) {
74 define('TEST_RUNNING', true);
75 $test = &new test_utf8_strrpos();
76 $reporter = & getTestReporter();
77 $test->run($reporter);