diff --git a/core/modules/block_content/config/install/views.view.block_content.yml b/core/modules/block_content/config/install/views.view.block_content.yml index d125bb8..19d0b7d 100644 --- a/core/modules/block_content/config/install/views.view.block_content.yml +++ b/core/modules/block_content/config/install/views.view.block_content.yml @@ -5,7 +5,7 @@ dependencies: - block_content - user id: block_content -label: 'Block content' +label: 'Custom block library' module: views description: 'Find and manage custom blocks.' tag: '' @@ -405,7 +405,7 @@ display: entity_field: type plugin_id: bundle sorts: { } - title: 'Block content' + title: 'Custom block library' header: { } footer: { } empty: diff --git a/core/modules/block_content/src/Tests/BlockContentListViewsTest.php b/core/modules/block_content/src/Tests/BlockContentListViewsTest.php index acd4990..71bebe1 100644 --- a/core/modules/block_content/src/Tests/BlockContentListViewsTest.php +++ b/core/modules/block_content/src/Tests/BlockContentListViewsTest.php @@ -44,9 +44,14 @@ public function testListing() { $this->assertEqual(count($elements), 4, 'Correct number of table header cells found.'); // Test the contents of each th cell. - $expected_items = [t('Block description'), t('Block Type'), t('Updated'), t('Operations')]; + $expected_items = [t('Block description'), t('Block type'), t('Updated'), t('Operations')]; foreach ($elements as $key => $element) { - $this->assertIdentical((string) $element[0], $expected_items[$key]); + if ($element->xpath('a')) { + $this->assertIdentical(trim((string) $element->xpath('a')[0]), $expected_items[$key]); + } + else { + $this->assertIdentical(trim((string) $element[0]), $expected_items[$key]); + } } $label = 'Antelope'; @@ -63,15 +68,15 @@ public function testListing() { // Confirm that once the user returns to the listing, the text of the label // (versus elsewhere on the page). - $this->assertFieldByXpath('//td', $label, 'Label found for added block.'); + $this->assertFieldByXpath('//td/a', $label, 'Label found for added block.'); // Check the number of table row cells. - $elements = $this->xpath('//div[@class="layout-content"]//table/tbody/tr[@class="odd"]/td'); - $this->assertEqual(count($elements), 2, 'Correct number of table row cells found.'); + $elements = $this->xpath('//div[@class="layout-content"]//table/tbody/tr/td'); + $this->assertEqual(count($elements), 4, 'Correct number of table row cells found.'); // Check the contents of each row cell. The first cell contains the label, // the second contains the machine name, and the third contains the // operations list. - $this->assertIdentical((string) $elements[0], $label); + $this->assertIdentical((string) $elements[0]->xpath('a')[0], $label); // Edit the entity using the operations link. $blocks = $this->container @@ -93,7 +98,7 @@ public function testListing() { // Confirm that once the user returns to the listing, the text of the label // (versus elsewhere on the page). - $this->assertFieldByXpath('//td', $new_label, 'Label found for updated custom block.'); + $this->assertFieldByXpath('//td/a', $new_label, 'Label found for updated custom block.'); // Delete the added entity using the operations link. $this->assertLinkByHref('block/' . $block->id() . '/delete');