You are here

function ThemeEarlyInitializationTest::testRequestListener in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/system/src/Tests/Theme/ThemeEarlyInitializationTest.php \Drupal\system\Tests\Theme\ThemeEarlyInitializationTest::testRequestListener()

Test that the theme system can generate output in a request listener.

File

core/modules/system/src/Tests/Theme/ThemeEarlyInitializationTest.php, line 30
Contains \Drupal\system\Tests\Theme\ThemeEarlyInitializationTest.

Class

ThemeEarlyInitializationTest
Tests that the theme system can be correctly initialized early in the page request.

Namespace

Drupal\system\Tests\Theme

Code

function testRequestListener() {
  $this
    ->drupalGet('theme-test/request-listener');

  // Verify that themed output generated in the request listener appears.
  $this
    ->assertRaw('Themed output generated in a KernelEvents::REQUEST listener');

  // Verify that the default theme's CSS still appears even though the theme
  // system was initialized early.
  $this
    ->assertRaw('classy/css/components/action-links.css');
}