Пример #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, '...'));
 }