function MigrateBlockTest::setUp

Same name in this branch
  1. 10 core/modules/forum/tests/src/Kernel/Migrate/d6/MigrateBlockTest.php \Drupal\Tests\forum\Kernel\Migrate\d6\MigrateBlockTest::setUp()
  2. 10 core/modules/block/tests/src/Kernel/Migrate/d6/MigrateBlockTest.php \Drupal\Tests\block\Kernel\Migrate\d6\MigrateBlockTest::setUp()
Same name in other branches
  1. 9 core/modules/aggregator/tests/src/Kernel/Migrate/d6/MigrateBlockTest.php \Drupal\Tests\aggregator\Kernel\Migrate\d6\MigrateBlockTest::setUp()
  2. 9 core/modules/block/tests/src/Kernel/Migrate/d6/MigrateBlockTest.php \Drupal\Tests\block\Kernel\Migrate\d6\MigrateBlockTest::setUp()
  3. 9 core/modules/block/tests/src/Kernel/Migrate/d7/MigrateBlockTest.php \Drupal\Tests\block\Kernel\Migrate\d7\MigrateBlockTest::setUp()
  4. 8.9.x core/modules/block/tests/src/Kernel/Migrate/d6/MigrateBlockTest.php \Drupal\Tests\block\Kernel\Migrate\d6\MigrateBlockTest::setUp()
  5. 8.9.x core/modules/block/tests/src/Kernel/Migrate/d7/MigrateBlockTest.php \Drupal\Tests\block\Kernel\Migrate\d7\MigrateBlockTest::setUp()
  6. 11.x core/modules/forum/tests/src/Kernel/Migrate/d6/MigrateBlockTest.php \Drupal\Tests\forum\Kernel\Migrate\d6\MigrateBlockTest::setUp()
  7. 11.x core/modules/block/tests/src/Kernel/Migrate/d6/MigrateBlockTest.php \Drupal\Tests\block\Kernel\Migrate\d6\MigrateBlockTest::setUp()
  8. 11.x 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 37

Class

MigrateBlockTest
Tests migration of blocks to configuration entities.

Namespace

Drupal\Tests\block\Kernel\Migrate\d7

Code

protected function setUp() : void {
    parent::setUp();
    $this->installEntitySchema('path_alias');
    // Install the themes used for this test.
    $this->installEntitySchema('block_content');
    $this->container
        ->get('theme_installer')
        ->install([
        'olivero',
        'claro',
    ]);
    $this->installConfig(static::$modules);
    // Set Olivero and Claro as the default public and admin theme.
    $config = $this->config('system.theme');
    $config->set('default', 'olivero');
    $config->set('admin', 'claro');
    $config->save();
    $this->executeMigrations([
        'd7_filter_format',
        'd7_user_role',
        'block_content_type',
        'block_content_body_field',
        'd7_custom_block',
        'd7_block',
    ]);
    block_rebuild();
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.