You are here

public function TruncateHTMLTest::testTruncateWords in Smart Trim 8

Covers TruncateWords.

@covers ::truncateWords

@dataProvider truncateWordsDataProvider

File

tests/src/Unit/TruncateHTMLTest.php, line 62

Class

TruncateHTMLTest
Unit Test coverage.

Namespace

Drupal\Tests\smart_trim\Unit

Code

public function testTruncateWords($html, $limit, $ellipsis, $expected) {
  $truncate = new TruncateHTML();
  $this
    ->assertSame($expected, $truncate
    ->truncateWords($html, $limit, $ellipsis));
}