1 theme.test ThemeHtmlTplPhpAttributesTestCase::testThemeHtmlTplPhpAttributes()

Tests that modules and themes can alter variables in html.tpl.php.

File

core/modules/simpletest/tests/theme.test, line 736
Tests for the theme API.

Class

ThemeHtmlTplPhpAttributesTestCase
Functional test for attributes of html.tpl.php.

Code

function testThemeHtmlTplPhpAttributes() {
  $this->backdropGet('');
  $attributes = $this->xpath('/html[@theme_test_html_attribute="theme test html attribute value"]');
  $this->assertTrue(count($attributes) == 1, t('Attribute set in the html element via hook_preprocess_html() found.'));
  $attributes = $this->xpath('/html/body[@theme_test_body_attribute="theme test body attribute value"]');
  $this->assertTrue(count($attributes) == 1, t('Attribute set in the body element via hook_preprocess_html() found.'));
}