function ThemeTest::testRegionClass
Same name in other branches
- 9 core/modules/system/tests/src/Functional/Theme/ThemeTest.php \Drupal\Tests\system\Functional\Theme\ThemeTest::testRegionClass()
- 10 core/modules/system/tests/src/Functional/Theme/ThemeTest.php \Drupal\Tests\system\Functional\Theme\ThemeTest::testRegionClass()
- 11.x core/modules/system/tests/src/Functional/Theme/ThemeTest.php \Drupal\Tests\system\Functional\Theme\ThemeTest::testRegionClass()
Tests that region attributes can be manipulated via preprocess functions.
File
-
core/
modules/ system/ tests/ src/ Functional/ Theme/ ThemeTest.php, line 160
Class
- ThemeTest
- Tests low-level theme functions.
Namespace
Drupal\Tests\system\Functional\ThemeCode
public function testRegionClass() {
\Drupal::service('module_installer')->install([
'block',
'theme_region_test',
]);
// Place a block.
$this->drupalPlaceBlock('system_main_block');
$this->drupalGet('');
$elements = $this->cssSelect(".region-sidebar-first.new_class");
$this->assertCount(1, $elements, 'New class found.');
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.