You are here

public function ThemeTest::testRegionClass in Drupal 9

Same name and namespace in other branches
  1. 8 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\Theme

Code

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.');
}