]> projects.mako.cc - scuttle/blob - includes/utf8/tests/cases/utf8_ucfirst.test.php
- Override privacy status on bookmark file import, if specified (i.e. Delicious)
[scuttle] / includes / utf8 / tests / cases / utf8_ucfirst.test.php
1 <?php
2 /**
3 * @version $Id: utf8_ucfirst.test.php,v 1.3 2006/02/26 13:07:42 harryf Exp $
4 * @package utf8
5 * @subpackage Tests
6 */
7
8 //--------------------------------------------------------------------
9 /**
10 * Includes
11 * @package utf8
12 * @subpackage Tests
13 */
14 require_once(dirname(__FILE__).'/../config.php');
15 require_once UTF8 . '/ucfirst.php';
16
17 //--------------------------------------------------------------------
18 /**
19 * @package utf8
20 * @subpackage Tests
21 */
22 class test_utf8_ucfirst extends UnitTestCase {
23
24     function test_utf8_ucfirst() {
25         $this->UnitTestCase('test_utf8_ucfirst()');
26     }
27     
28     function testUcfirst() {
29         $str = 'ñtërnâtiônàlizætiøn';
30         $ucfirst = 'Ñtërnâtiônàlizætiøn';
31         $this->assertEqual(utf8_ucfirst($str),$ucfirst);
32     }
33     
34     function testUcfirstSpace() {
35         $str = ' iñtërnâtiônàlizætiøn';
36         $ucfirst = ' iñtërnâtiônàlizætiøn';
37         $this->assertEqual(utf8_ucfirst($str),$ucfirst);
38     }
39     
40     function testUcfirstUpper() {
41         $str = 'Ñtërnâtiônàlizætiøn';
42         $ucfirst = 'Ñtërnâtiônàlizætiøn';
43         $this->assertEqual(utf8_ucfirst($str),$ucfirst);
44     }
45     
46     function testEmptyString() {
47         $str = '';
48         $this->assertEqual(utf8_ucfirst($str),'');
49     }
50     
51     function testOneChar() {
52         $str = 'ñ';
53         $ucfirst = "Ñ";
54         $this->assertEqual(utf8_ucfirst($str),$ucfirst);
55     }
56     
57     function testLinefeed() {
58         $str = "ñtërn\nâtiônàlizætiøn";
59         $ucfirst = "Ñtërn\nâtiônàlizætiøn";
60         $this->assertEqual(utf8_ucfirst($str),$ucfirst);
61     }
62     
63 }
64
65 //--------------------------------------------------------------------
66 /**
67 * @package utf8
68 * @subpackage Tests
69 */
70 if (!defined('TEST_RUNNING')) {
71     define('TEST_RUNNING', true);
72     $test = &new test_utf8_ucfirst();
73     $reporter = & getTestReporter();
74     $test->run($reporter);
75 }

Benjamin Mako Hill || Want to submit a patch?