You are here

public function HtmlTitleFormatterTest::testHtmlTitleFormatter in HTML Title 8

Test html_title formatter.

@dataProvider htmlTitleFormatterDataProvider

File

tests/src/Kernel/HtmlTitleFormatterTest.php, line 97

Class

HtmlTitleFormatterTest
Test the HTML Title formatter.

Namespace

Drupal\Tests\html_title\Kernel

Code

public function testHtmlTitleFormatter(string $expected, string $value) {
  $entity = $this->entityTypeManager
    ->getStorage($this->entityTypeId)
    ->create([]);
  $entity
    ->set($this->fieldName, [
    'value' => $value,
  ]);
  $build = $this
    ->buildEntityField($entity, $this->fieldName, 'html_title');
  $this
    ->render($build);
  $this
    ->assertRaw($expected);
}