You are here

public function ThemeTest::testThemeOnNonHtmlRequest in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/system/tests/src/Functional/Theme/ThemeTest.php \Drupal\Tests\system\Functional\Theme\ThemeTest::testThemeOnNonHtmlRequest()

Ensures that non-HTML requests never initialize themes.

File

core/modules/system/tests/src/Functional/Theme/ThemeTest.php, line 65

Class

ThemeTest
Tests low-level theme functions.

Namespace

Drupal\Tests\system\Functional\Theme

Code

public function testThemeOnNonHtmlRequest() {
  $this
    ->drupalGet('theme-test/non-html');
  $json = Json::decode($this
    ->getSession()
    ->getPage()
    ->getContent());
  $this
    ->assertFalse($json['theme_initialized']);
}