You are here

public function TruncateHTMLTest::testTruncateChars in Smart Trim 8

Testing truncateChars.

@covers ::truncateChars

@dataProvider truncateCharsDataProvider

File

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

Class

TruncateHTMLTest
Unit Test coverage.

Namespace

Drupal\Tests\smart_trim\Unit

Code

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