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