You are here

protected function BlockStorageUnitTest::deleteTests in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/block/src/Tests/BlockStorageUnitTest.php \Drupal\block\Tests\BlockStorageUnitTest::deleteTests()

Tests the deleting of blocks.

1 call to BlockStorageUnitTest::deleteTests()
BlockStorageUnitTest::testBlockCRUD in core/modules/block/src/Tests/BlockStorageUnitTest.php
Tests CRUD operations.

File

core/modules/block/src/Tests/BlockStorageUnitTest.php, line 128
Contains \Drupal\block\Tests\BlockStorageUnitTest.

Class

BlockStorageUnitTest
Tests the storage of blocks.

Namespace

Drupal\block\Tests

Code

protected function deleteTests() {
  $entity = $this->controller
    ->load('test_block');

  // Ensure that the storage isn't currently empty.
  $config_storage = $this->container
    ->get('config.storage');
  $config = $config_storage
    ->listAll('block.block.');
  $this
    ->assertFalse(empty($config), 'There are blocks in config storage.');

  // Delete the block.
  $entity
    ->delete();

  // Ensure that the storage is now empty.
  $config = $config_storage
    ->listAll('block.block.');
  $this
    ->assertTrue(empty($config), 'There are no blocks in config storage.');
}