diff --git a/core/profiles/demo_umami/config/optional/block.block.umami_banner_front.yml b/core/profiles/demo_umami/config/optional/block.block.umami_banner_home.yml similarity index 92% rename from core/profiles/demo_umami/config/optional/block.block.umami_banner_front.yml rename to core/profiles/demo_umami/config/optional/block.block.umami_banner_home.yml index 8f79b4e762..7af458eb35 100644 --- a/core/profiles/demo_umami/config/optional/block.block.umami_banner_front.yml +++ b/core/profiles/demo_umami/config/optional/block.block.umami_banner_home.yml @@ -11,7 +11,7 @@ dependencies: - system theme: - umami -id: umami_banner_front +id: umami_banner_home theme: umami region: banner_top weight: -7 @@ -19,7 +19,7 @@ provider: null plugin: 'block_content:9aadf4a1-ded6-4017-a10d-a5e043396edf' settings: id: 'block_content:9aadf4a1-ded6-4017-a10d-a5e043396edf' - label: 'Umami Front Banner' + label: 'Umami Home Banner' provider: block_content label_display: '0' status: true diff --git a/core/profiles/demo_umami/modules/demo_umami_content/src/InstallHelper.php b/core/profiles/demo_umami/modules/demo_umami_content/src/InstallHelper.php index 41fbc5014a..103119726f 100644 --- a/core/profiles/demo_umami/modules/demo_umami_content/src/InstallHelper.php +++ b/core/profiles/demo_umami/modules/demo_umami_content/src/InstallHelper.php @@ -329,9 +329,9 @@ protected function importPages() { protected function importBlockContent() { $module_path = $this->moduleHandler->getModule('demo_umami_content')->getPath(); $block_content_entities = [ - 'umami_front_banner' => [ + 'umami_home_banner' => [ 'uuid' => '9aadf4a1-ded6-4017-a10d-a5e043396edf', - 'info' => 'Umami Front Banner', + 'info' => 'Umami Home Banner', 'type' => 'banner_block', 'field_title' => [ 'value' => 'Super easy vegetarian pasta bake', @@ -357,14 +357,14 @@ protected function importBlockContent() { 'info' => 'Umami Recipes Banner', 'type' => 'banner_block', 'field_title' => [ - 'value' => 'Vegan chocolate brownies', + 'value' => 'Vegan chocolate and nut brownies', ], 'field_content_link' => [ 'uri' => 'internal:' . call_user_func(function () { - $nodes = $this->entityTypeManager->getStorage('node')->loadByProperties(['title' => 'Vegan chocolate and nut brownies']); - $node = reset($nodes); - return $this->aliasManager->getAliasByPath('/node/' . $node->id()); - }), + $nodes = $this->entityTypeManager->getStorage('node')->loadByProperties(['title' => 'Vegan chocolate and nut brownies']); + $node = reset($nodes); + return $this->aliasManager->getAliasByPath('/node/' . $node->id()); + }), 'title' => 'VIEW RECIPE', ], 'field_summary' => [ diff --git a/core/profiles/demo_umami/modules/demo_umami_content/tests/src/Functional/UninstallDefaultContentTest.php b/core/profiles/demo_umami/modules/demo_umami_content/tests/src/Functional/UninstallDefaultContentTest.php index 3c662bc4bb..ba3957fefd 100644 --- a/core/profiles/demo_umami/modules/demo_umami_content/tests/src/Functional/UninstallDefaultContentTest.php +++ b/core/profiles/demo_umami/modules/demo_umami_content/tests/src/Functional/UninstallDefaultContentTest.php @@ -73,7 +73,6 @@ public function testReinstall() { $this->assertRecipesImported($node_storage); $this->assertArticlesImported($node_storage); $this->assertImportedCustomBlock($block_storage); - } /** @@ -122,14 +121,17 @@ protected function assertImportedCustomBlock(EntityStorageInterface $block_stora $assert = $this->assertSession(); foreach ($this->expectedBlocks() as $block_info) { $this->drupalGet($block_info['path']); + // Verify that the block is placed. $assert->pageTextContains($block_info['unique_text']); + // For blocks that have image alt text, also verify the presence of the // expected alt text. if (isset($block_info['image_alt_text'])) { $img_alt_text = $assert->elementExists('css', $block_info['image_css_selector'])->getAttribute('alt'); $this->assertEquals($block_info['image_alt_text'], $img_alt_text); } + // Verify that the block can be loaded. $count = $block_storage->getQuery() ->condition('type', $block_info['type']) @@ -140,8 +142,7 @@ protected function assertImportedCustomBlock(EntityStorageInterface $block_stora $this->assertCount(1, $block); } } - - + /** * Returns the expected properties of this profile's custom blocks. */ @@ -152,7 +153,7 @@ protected function expectedBlocks() { 'type' => 'banner_block', 'uuid' => '9aadf4a1-ded6-4017-a10d-a5e043396edf', 'unique_text' => 'A wholesome pasta bake is the ultimate comfort food.', - 'image_css_selector' => '#block-umami-banner-front img', + 'image_css_selector' => '#block-umami-banner-home img', 'image_alt_text' => 'Mouth watering vegetarian pasta bake with rich tomato sauce and cheese toppings', ], [ @@ -179,6 +180,4 @@ protected function expectedBlocks() { ], ]; } - } -