You are here

protected function MigrateBlockTest::setUp in Drupal 8

Same name in this branch
  1. 8 core/modules/block/tests/src/Kernel/Migrate/d6/MigrateBlockTest.php \Drupal\Tests\block\Kernel\Migrate\d6\MigrateBlockTest::setUp()
  2. 8 core/modules/block/tests/src/Kernel/Migrate/d7/MigrateBlockTest.php \Drupal\Tests\block\Kernel\Migrate\d7\MigrateBlockTest::setUp()
Same name and namespace in other branches
  1. 9 core/modules/block/tests/src/Kernel/Migrate/d7/MigrateBlockTest.php \Drupal\Tests\block\Kernel\Migrate\d7\MigrateBlockTest::setUp()

Overrides MigrateDrupal7TestBase::setUp

File

core/modules/block/tests/src/Kernel/Migrate/d7/MigrateBlockTest.php, line 35

Class

MigrateBlockTest
Tests migration of blocks to configuration entities.

Namespace

Drupal\Tests\block\Kernel\Migrate\d7

Code

protected function setUp() {
  parent::setUp();

  // Install the themes used for this test.
  $this->container
    ->get('theme_installer')
    ->install([
    'bartik',
    'seven',
  ]);
  $this
    ->installEntitySchema('block_content');
  $this
    ->installConfig(static::$modules);

  // Set Bartik and Seven as the default public and admin theme.
  $config = $this
    ->config('system.theme');
  $config
    ->set('default', 'bartik');
  $config
    ->set('admin', 'seven');
  $config
    ->save();
  $this
    ->executeMigrations([
    'd7_filter_format',
    'd7_user_role',
    'block_content_type',
    'block_content_body_field',
    'd7_custom_block',
    'd7_block',
  ]);
  block_rebuild();
}