From 2f17715ceff5885bd5f7a3b1badc5de5b85ef985 Mon Sep 17 00:00:00 2001 From: Alex Pott Date: Wed, 10 Sep 2014 12:22:40 +0100 Subject: [PATCH] Issue #1530774 by lokapujya, jenlampton, Cottser, svdhout, alexrayu, hpz: Fixed Test coverage for adding classes into region template. --- core/modules/system/src/Tests/Theme/ThemeTest.php | 13 +++++++++++++ .../theme_region_test/theme_region_test.info.yml | 6 ++++++ .../theme_region_test/theme_region_test.module | 15 +++++++++++++++ 3 files changed, 34 insertions(+) create mode 100644 core/modules/system/tests/modules/theme_region_test/theme_region_test.info.yml create mode 100644 core/modules/system/tests/modules/theme_region_test/theme_region_test.module diff --git a/core/modules/system/src/Tests/Theme/ThemeTest.php b/core/modules/system/src/Tests/Theme/ThemeTest.php index 51951631b00..80d21d5d3bb 100644 --- a/core/modules/system/src/Tests/Theme/ThemeTest.php +++ b/core/modules/system/src/Tests/Theme/ThemeTest.php @@ -278,4 +278,17 @@ class ThemeTest extends WebTestBase { $this->assertText('theme test page bottom markup', 'Modules are able to set the page bottom region.'); } + /** + * Tests that region attributes can be manipulated via preprocess functions. + */ + function testRegionClass() { + \Drupal::moduleHandler()->install(array('block', 'theme_region_test')); + + // Place a block. + $this->drupalPlaceBlock('system_main_block'); + $this->drupalGet(''); + $elements = $this->cssSelect(".region-sidebar-first.new_class"); + $this->assertEqual(count($elements), 1, 'New class found.'); + } + } diff --git a/core/modules/system/tests/modules/theme_region_test/theme_region_test.info.yml b/core/modules/system/tests/modules/theme_region_test/theme_region_test.info.yml new file mode 100644 index 00000000000..0cf5fe3139b --- /dev/null +++ b/core/modules/system/tests/modules/theme_region_test/theme_region_test.info.yml @@ -0,0 +1,6 @@ +name: 'Theme region test' +type: module +description: 'Provides hook implementations for testing regions.' +package: Testing +version: VERSION +core: 8.x diff --git a/core/modules/system/tests/modules/theme_region_test/theme_region_test.module b/core/modules/system/tests/modules/theme_region_test/theme_region_test.module new file mode 100644 index 00000000000..6efad6d1156 --- /dev/null +++ b/core/modules/system/tests/modules/theme_region_test/theme_region_test.module @@ -0,0 +1,15 @@ +