HtmlAttributesTest.php in Zircon Profile 8
File
core/modules/system/src/Tests/Theme/HtmlAttributesTest.php
View source
<?php
namespace Drupal\system\Tests\Theme;
use Drupal\simpletest\WebTestBase;
class HtmlAttributesTest extends WebTestBase {
public static $modules = array(
'theme_test',
);
function testThemeHtmlAttributes() {
$this
->drupalGet('');
$attributes = $this
->xpath('/html[@theme_test_html_attribute="theme test html attribute value"]');
$this
->assertTrue(count($attributes) == 1, "Attribute set in the 'html' element via hook_preprocess_HOOK() found.");
$attributes = $this
->xpath('/html/body[@theme_test_body_attribute="theme test body attribute value"]');
$this
->assertTrue(count($attributes) == 1, "Attribute set in the 'body' element via hook_preprocess_HOOK() found.");
}
}