public function TruncateHTMLTest::truncateWordsDataProvider in Smart Trim 8
Data provider for testTruncateWords().
File
- tests/
src/ Unit/ TruncateHTMLTest.php, line 70
Class
- TruncateHTMLTest
- Unit Test coverage.
Namespace
Drupal\Tests\smart_trim\UnitCode
public function truncateWordsDataProvider() {
return [
[
'A test string',
2,
'…',
'A test…',
],
[
'A test string',
3,
'…',
'A test string',
],
[
'“I like funky quotes”',
2,
'',
'“I like',
],
[
'“I like funky quotes”',
4,
'',
'“I like funky quotes”',
],
[
'“I <em>really, really</em> like funky quotes”',
2,
'',
'“I <em>really,</em>',
],
];
}