示例#1
0
 public function testShouldTruncateTextWithoutGap()
 {
     $text = 'Loremipsumdolorsitamet';
     $this->assertEquals('Loremipsumdolorsi...', StringUtil::truncate($text, 17, '...'));
 }
示例#2
0
 public function testShouldTruncateTextWithGivenEnding()
 {
     $text = 'Lorem ipsum dolor sit amet';
     $this->assertEquals('Lorem ipsum dolor sit...', StringUtil::truncate($text, 21, '...'));
 }