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