public function BlockStorageUnitTest::testDefaultBlocks

Tests the installation of default blocks.

File

drupal/core/modules/block/lib/Drupal/block/Tests/BlockStorageUnitTest.php, line 204
Contains \Drupal\block\Tests\BlockStorageUnitTest.

Class

BlockStorageUnitTest
Tests the storage of blocks.

Namespace

Drupal\block\Tests

Code

public function testDefaultBlocks() {
  $entities = $this->controller
    ->load();
  $this
    ->assertTrue(empty($entities), 'There are no blocks initially.');

  // Install the block_test.module, so that its default config is installed.
  $this
    ->installConfig(array(
    'block_test',
  ));
  $entities = $this->controller
    ->load();
  $entity = reset($entities);
  $this
    ->assertEqual($entity
    ->id(), 'stark.test_block', 'The default test block was loaded.');
}