You are here

public function MessageTextHandlerTest::testTextHandler in Message 8

Testing the deletion of messages in cron according to settings.

File

tests/src/Functional/MessageTextHandlerTest.php, line 38

Class

MessageTextHandlerTest
Test the views text handler.

Namespace

Drupal\Tests\message\Functional

Code

public function testTextHandler() {
  $text = [
    [
      'value' => 'Dummy text message',
      'format' => 'filtered_html',
    ],
  ];
  $this
    ->createMessageTemplate('dummy_message', 'Dummy message', '', $text);
  Message::create([
    'template' => 'dummy_message',
  ])
    ->save();
  $this
    ->drupalLogin($this->account);
  $this
    ->drupalGet('admin/content/messages');
  $this
    ->assertText('Dummy text message');
  $this
    ->drupalGet('message-test');
  $this
    ->assertText('Dummy text message');
}