public function MessageTextHandlerTest::testHtmlTextHandler in Message 8
Testing the message text is not empty if it contains html.
File
- tests/src/ Functional/ MessageTextHandlerTest.php, line 56 
Class
- MessageTextHandlerTest
- Test the views text handler.
Namespace
Drupal\Tests\message\FunctionalCode
public function testHtmlTextHandler() {
  $text = [
    [
      'value' => htmlspecialchars('<p> Some HTML text</p>'),
      'format' => 'full_html',
    ],
  ];
  $this
    ->createMessageTemplate('html_dummy_message', 'HTML Dummy message', '', $text);
  Message::create([
    'template' => 'html_dummy_message',
  ])
    ->save();
  $this
    ->drupalLogin($this->account);
  $this
    ->drupalGet('admin/content/message');
  $this
    ->assertText(htmlspecialchars('<p> Some HTML text</p>'));
}