function ThemeTest::testThemeOnNonHtmlRequest

Same name in other branches
  1. 9 core/modules/system/tests/src/Functional/Theme/ThemeTest.php \Drupal\Tests\system\Functional\Theme\ThemeTest::testThemeOnNonHtmlRequest()
  2. 8.9.x core/modules/system/tests/src/Functional/Theme/ThemeTest.php \Drupal\Tests\system\Functional\Theme\ThemeTest::testThemeOnNonHtmlRequest()
  3. 11.x 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 68

Class

ThemeTest
Tests low-level theme functions.

Namespace

Drupal\Tests\system\Functional\Theme

Code

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

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