function AreaMessagesTest::testMessageText

Same name in other branches
  1. 8.9.x core/modules/views/tests/src/Kernel/Handler/AreaMessagesTest.php \Drupal\Tests\views\Kernel\Handler\AreaMessagesTest::testMessageText()
  2. 10 core/modules/views/tests/src/Kernel/Handler/AreaMessagesTest.php \Drupal\Tests\views\Kernel\Handler\AreaMessagesTest::testMessageText()
  3. 11.x core/modules/views/tests/src/Kernel/Handler/AreaMessagesTest.php \Drupal\Tests\views\Kernel\Handler\AreaMessagesTest::testMessageText()

Tests the messages area handler.

File

core/modules/views/tests/src/Kernel/Handler/AreaMessagesTest.php, line 26

Class

AreaMessagesTest
Tests the messages area handler.

Namespace

Drupal\Tests\views\Kernel\Handler

Code

public function testMessageText() {
    \Drupal::messenger()->addStatus('My drupal set message.');
    $view = Views::getView('test_area_messages');
    $view->setDisplay('default');
    $this->executeView($view);
    $output = $view->render();
    $output = \Drupal::service('renderer')->renderRoot($output);
    $this->setRawContent($output);
    $this->assertText('My drupal set message.');
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.