Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / modules / block_content / tests / src / Functional / BlockContentListViewsTest.php
index 1c623be82eba3c9cf4af6525a00f07fa3971df37..f9cf29eb77bcc20ea4c47a4871c3f2d10d25ab9e 100644 (file)
@@ -2,6 +2,8 @@
 
 namespace Drupal\Tests\block_content\Functional;
 
+use Drupal\block_content\Entity\BlockContent;
+
 /**
  * Tests the Views-powered listing of custom blocks.
  *
@@ -112,6 +114,19 @@ class BlockContentListViewsTest extends BlockContentTestBase {
     // Confirm that the empty text is displayed.
     $this->assertText('There are no custom blocks available.');
     $this->assertLink('custom block');
+
+    $block_content = BlockContent::create([
+      'info' => 'Non-reusable block',
+      'type' => 'basic',
+      'reusable' => FALSE,
+    ]);
+    $block_content->save();
+
+    $this->drupalGet('admin/structure/block/block-content');
+    // Confirm that the empty text is displayed.
+    $this->assertSession()->pageTextContains('There are no custom blocks available.');
+    // Confirm the non-reusable block is not on the page.
+    $this->assertSession()->pageTextNotContains('Non-reusable block');
   }
 
 }