function ThemeTest::testPreprocessHtml in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/modules/system/src/Tests/Theme/ThemeTest.php \Drupal\system\Tests\Theme\ThemeTest::testPreprocessHtml()
Tests that the page variable is not prematurely flattened.
Some modules check the page array in template_preprocess_html(), so we ensure that it has not been rendered prematurely.
File
- core/
modules/ system/ src/ Tests/ Theme/ ThemeTest.php, line 278 - Contains \Drupal\system\Tests\Theme\ThemeTest.
Class
- ThemeTest
- Tests low-level theme functions.
Namespace
Drupal\system\Tests\ThemeCode
function testPreprocessHtml() {
$this
->drupalGet('');
$attributes = $this
->xpath('/html/body[@theme_test_page_variable="Page variable is an array."]');
$this
->assertTrue(count($attributes) == 1, 'In template_preprocess_html(), the page variable is still an array (not rendered yet).');
$this
->assertText('theme test page bottom markup', 'Modules are able to set the page bottom region.');
}