3 namespace Drupal\Tests\system\Kernel\Render;
5 use Drupal\KernelTests\KernelTestBase;
8 * Tests the Classy theme.
12 class ClassyTest extends KernelTestBase {
17 public static $modules = ['system', 'twig_theme_test'];
22 public function setUp() {
25 // Use the classy theme.
26 $this->container->get('theme_installer')->install(['classy']);
27 $this->container->get('config.factory')
28 ->getEditable('system.theme')
29 ->set('default', 'classy')
31 // Clear the theme registry.
32 $this->container->set('theme.registry', NULL);
37 * Test the classy theme.
39 public function testClassyTheme() {
40 \Drupal::messenger()->addError('An error occurred');
41 \Drupal::messenger()->addStatus('But then something nice happened');
43 '#type' => 'status_messages',
45 $this->render($messages);
46 $this->assertNoText('custom-test-messages-class', 'The custom class attribute value added in the status messages preprocess function is not displayed as page content.');