function ClassyTest::testClassyTheme

Same name in other branches
  1. 8.9.x core/modules/system/tests/src/Kernel/Render/ClassyTest.php \Drupal\Tests\system\Kernel\Render\ClassyTest::testClassyTheme()

Tests the classy theme.

File

core/themes/classy/tests/src/Kernel/ClassyTest.php, line 40

Class

ClassyTest
Tests the Classy theme.

Namespace

Drupal\Tests\classy\Kernel

Code

public function testClassyTheme() {
    \Drupal::messenger()->addError('An error occurred');
    \Drupal::messenger()->addStatus('But then something nice happened');
    $messages = [
        '#type' => 'status_messages',
    ];
    $this->render($messages);
    $this->assertNoText('custom-test-messages-class', 'The custom class attribute value added in the status messages preprocess function is not displayed as page content.');
}

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