Changeset 22567 for branches/version-2_12-dev/tests/class/util/SC_Utils/SC_Utils_sfCutStringTest.php
- Timestamp:
- 2013/02/18 19:09:54 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2_12-dev/tests/class/util/SC_Utils/SC_Utils_sfCutStringTest.php
r22206 r22567 32 32 * @version $Id$ 33 33 */ 34 class SC_Utils_sfCutStringTest extends Common_TestCase { 34 class SC_Utils_sfCutStringTest extends Common_TestCase 35 { 35 36 36 37 37 protected function setUp() { 38 protected function setUp() 39 { 38 40 // parent::setUp(); 39 41 } 40 42 41 protected function tearDown() { 43 protected function tearDown() 44 { 42 45 // parent::tearDown(); 43 46 } 44 47 45 48 ///////////////////////////////////////// 46 public function testSfCutString_マルチバイト指定で指定長より2文字以上長い場合_指定長でカットされる() { 49 public function testSfCutString_マルチバイト指定で指定長より2文字以上長い場合_指定長でカットされる() 50 { 47 51 $input = 'あいうえおABC、こんにちは。'; 48 52 $this->expected = 'あいうえおABC、こんにち...'; … … 52 56 } 53 57 54 public function testSfCutString_マルチバイト指定で指定長より1文字長い場合_カットされない() { 58 public function testSfCutString_マルチバイト指定で指定長より1文字長い場合_カットされない() 59 { 55 60 $input = 'あいうえおABC、こんにちは'; 56 61 $this->expected = 'あいうえおABC、こんにちは'; … … 60 65 } 61 66 62 public function testSfCutString_マルチバイト指定で指定長以内の場合_カットされない() { 67 public function testSfCutString_マルチバイト指定で指定長以内の場合_カットされない() 68 { 63 69 $input = 'あいうえおABC、こんにち'; 64 70 $this->expected = 'あいうえおABC、こんにち'; … … 68 74 } 69 75 70 public function testSfCutString_1バイト指定で指定長より3文字以上長い場合_指定長でカットされる() { 76 public function testSfCutString_1バイト指定で指定長より3文字以上長い場合_指定長でカットされる() 77 { 71 78 $input = 'hello, world!!'; 72 79 $this->expected = 'hello, worl...'; … … 76 83 } 77 84 78 public function testSfCutString_1バイト指定で指定長より2文字長い場合_カットされない() { 85 public function testSfCutString_1バイト指定で指定長より2文字長い場合_カットされない() 86 { 79 87 $input = 'hello, world!'; 80 88 $this->expected = 'hello, world!'; … … 84 92 } 85 93 86 public function testSfCutString_1バイト指定で指定長より1文字長い場合_カットされない() { 94 public function testSfCutString_1バイト指定で指定長より1文字長い場合_カットされない() 95 { 87 96 $input = 'hello, world'; 88 97 $this->expected = 'hello, world'; … … 92 101 } 93 102 94 public function testSfCutString_1バイト指定で指定長以内の場合_カットされない() { 103 public function testSfCutString_1バイト指定で指定長以内の場合_カットされない() 104 { 95 105 $input = 'hello, worl'; 96 106 $this->expected = 'hello, worl'; … … 101 111 102 112 // [までの場合 103 public function testSfCutString_絵文字を含んでカットされる場合_中途半端な絵文字がカットされる1() { 113 public function testSfCutString_絵文字を含んでカットされる場合_中途半端な絵文字がカットされる1() 114 { 104 115 $input = "hello[emoji:135], world."; 105 116 $this->expected = 'hello...'; … … 110 121 111 122 // ]の直前までの場合 112 public function testSfCutString_絵文字を含んでカットされる場合_中途半端な絵文字がカットされる2() { 123 public function testSfCutString_絵文字を含んでカットされる場合_中途半端な絵文字がカットされる2() 124 { 113 125 $input = "hello[emoji:135], world."; 114 126 $this->expected = 'hello...'; … … 119 131 120 132 // 最初の絵文字の途中 121 public function testSfCutString_複数の絵文字を含んでいてカットされる場合_中途半端な絵文字がカットされる1() { 133 public function testSfCutString_複数の絵文字を含んでいてカットされる場合_中途半端な絵文字がカットされる1() 134 { 122 135 $input = "hello[emoji:100][emoji:20], world![emoji:10]"; 123 136 $this->expected = 'hello...'; … … 128 141 129 142 // 2つめの絵文字の途中 130 public function testSfCutString_複数の絵文字を含んでいてカットされる場合_中途半端な絵文字がカットされる2() { 143 public function testSfCutString_複数の絵文字を含んでいてカットされる場合_中途半端な絵文字がカットされる2() 144 { 131 145 $input = "hello[emoji:100][emoji:20], world![emoji:10]"; 132 146 $this->expected = 'hello[emoji:100]...'; … … 137 151 138 152 // 3つめの絵文字の途中 139 public function testSfCutString_複数の絵文字を含んでいてカットされる場合_中途半端な絵文字がカットされる3() { 153 public function testSfCutString_複数の絵文字を含んでいてカットされる場合_中途半端な絵文字がカットされる3() 154 { 140 155 $input = "hello[emoji:100][emoji:20], world![emoji:10]"; 141 156 $this->expected = 'hello[emoji:100][emoji:20], wo...'; … … 146 161 147 162 // TODO 要確認 三点リーダ付けない場合は、lenと比較した方が良いのでは? 148 public function testSfCutString_三点リーダ付加指定がない場合_付加されない() { 163 public function testSfCutString_三点リーダ付加指定がない場合_付加されない() 164 { 149 165 $input = 'hello, world'; 150 166 $this->expected = 'hello';
Note: See TracChangeset
for help on using the changeset viewer.