class HtmlAttributesTest
Same name and namespace in other branches
- 11.x core/modules/system/tests/src/Functional/Theme/HtmlAttributesTest.php \Drupal\Tests\system\Functional\Theme\HtmlAttributesTest
- 10 core/modules/system/tests/src/Functional/Theme/HtmlAttributesTest.php \Drupal\Tests\system\Functional\Theme\HtmlAttributesTest
- 8.9.x core/modules/system/tests/src/Functional/Theme/HtmlAttributesTest.php \Drupal\Tests\system\Functional\Theme\HtmlAttributesTest
Tests attributes inserted in the 'html' and 'body' elements on the page.
@group Theme
Hierarchy
- class \Drupal\Tests\BrowserTestBase uses \Drupal\Core\Test\FunctionalTestSetupTrait, \Drupal\Tests\UiHelperTrait, \Drupal\Core\Test\TestSetupTrait, \Drupal\Tests\block\Traits\BlockCreationTrait, \Drupal\FunctionalTests\AssertLegacyTrait, \Drupal\Tests\RandomGeneratorTrait, \Drupal\Tests\node\Traits\NodeCreationTrait, \Drupal\Tests\node\Traits\ContentTypeCreationTrait, \Drupal\Tests\ConfigTestTrait, \Drupal\Tests\TestRequirementsTrait, \Drupal\Tests\user\Traits\UserCreationTrait, \Drupal\Tests\XdebugRequestTrait, \Drupal\Tests\Traits\PhpUnitWarnings, \Drupal\Tests\PhpUnitCompatibilityTrait, \Symfony\Bridge\PhpUnit\ExpectDeprecationTrait, \Drupal\Tests\ExtensionListTestTrait extends \PHPUnit\Framework\TestCase
- class \Drupal\Tests\system\Functional\Theme\HtmlAttributesTest extends \Drupal\Tests\BrowserTestBase
Expanded class hierarchy of HtmlAttributesTest
File
-
core/
modules/ system/ tests/ src/ Functional/ Theme/ HtmlAttributesTest.php, line 12
Namespace
Drupal\Tests\system\Functional\ThemeView source
class HtmlAttributesTest extends BrowserTestBase {
/**
* Modules to enable.
*
* @var array
*/
protected static $modules = [
'theme_test',
];
/**
* {@inheritdoc}
*/
protected $defaultTheme = 'stark';
/**
* Tests that attributes in the 'html' and 'body' elements can be altered.
*/
public function testThemeHtmlAttributes() {
$this->drupalGet('');
$this->assertSession()
->responseContains('<html lang="en" dir="ltr" theme_test_html_attribute="theme test html attribute value">');
$this->assertSession()
->elementsCount('xpath', '/body[@theme_test_body_attribute="theme test body attribute value"]', 1);
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.