You are here

public function MessageUiShowPreviewTest::testMessageUiPreviewDisplaying in Message UI 8

Testing the displaying of the preview.

File

tests/src/Functional/MessageUiShowPreviewTest.php, line 39

Class

MessageUiShowPreviewTest
Testing the display of the preview.

Namespace

Drupal\Tests\message_ui\Functional

Code

public function testMessageUiPreviewDisplaying() {

  // User login.
  $this
    ->drupalLogin($this->account);

  // Verify the user can't create the message.
  $this
    ->drupalGet('/message/add/foo');

  // Make sure we can see the message text.
  $this
    ->assertSession()
    ->pageTextContains('Dummy message');

  // Don't show the message text.
  $this
    ->configSet('show_preview', FALSE);
  drupal_static_reset();

  // Verify the user can't create the message.
  $this
    ->drupalGet('/message/add/foo');

  // Make sure we can see the message text.
  $this
    ->assertSession()
    ->pageTextNotContains('Dummy message');
}