diff --git a/core/modules/block_content/src/Tests/BlockContentListTest.php b/core/modules/block_content/src/Tests/BlockContentListTest.php index 03b60e3..ce2ad35 100644 --- a/core/modules/block_content/src/Tests/BlockContentListTest.php +++ b/core/modules/block_content/src/Tests/BlockContentListTest.php @@ -12,8 +12,11 @@ /** * Tests the listing of custom blocks. * + * Tests the fallback block content list when views is disabled. + * * @group block_content * @see \Drupal\block\BlockContentListBuilder + * @see \Drupal\block_content\Tests\BlockContentListViewsTest */ class BlockContentListTest extends BlockContentTestBase { diff --git a/core/modules/block_content/src/Tests/BlockContentListTest.php b/core/modules/block_content/src/Tests/BlockContentListViewsTest.php similarity index 86% copy from core/modules/block_content/src/Tests/BlockContentListTest.php copy to core/modules/block_content/src/Tests/BlockContentListViewsTest.php index 03b60e3..acd4990 100644 --- a/core/modules/block_content/src/Tests/BlockContentListTest.php +++ b/core/modules/block_content/src/Tests/BlockContentListViewsTest.php @@ -2,7 +2,7 @@ /** * @file - * Contains \Drupal\block_content\Tests\BlockContentListTest. + * Contains \Drupal\block_content\Tests\BlockContentListViewsTest. */ namespace Drupal\block_content\Tests; @@ -10,19 +10,20 @@ use Drupal\simpletest\WebTestBase; /** - * Tests the listing of custom blocks. + * Tests the views-powered listing of custom blocks. * * @group block_content * @see \Drupal\block\BlockContentListBuilder + * @see \Drupal\block_content\Tests\BlockContentListTest */ -class BlockContentListTest extends BlockContentTestBase { +class BlockContentListViewsTest extends BlockContentTestBase { /** * Modules to enable. * * @var array */ - public static $modules = array('block', 'block_content', 'config_translation'); + public static $modules = ['block', 'block_content', 'config_translation', 'views']; /** * Tests the custom block listing page. @@ -36,14 +37,14 @@ public function testListing() { // Test for the table. $element = $this->xpath('//div[@class="layout-content"]//table'); - $this->assertTrue($element, 'Configuration entity list table found.'); + $this->assertTrue($element, 'Views table found.'); // Test the table header. $elements = $this->xpath('//div[@class="layout-content"]//table/thead/tr/th'); - $this->assertEqual(count($elements), 2, 'Correct number of table header cells found.'); + $this->assertEqual(count($elements), 4, 'Correct number of table header cells found.'); // Test the contents of each th cell. - $expected_items = array(t('Block description'), 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]); } @@ -107,7 +108,7 @@ public function testListing() { $this->assertNoFieldByXpath('//td', $new_label, 'No label found for deleted custom block.'); // Confirm that the empty text is displayed. - $this->assertText(t('There is no Custom block yet.')); + $this->assertText(t('No custom blocks available.')); } }