MigrateBlockContentTypeTest.php

Same filename in other branches
  1. 9 core/modules/block_content/tests/src/Kernel/Migrate/MigrateBlockContentTypeTest.php
  2. 10 core/modules/block_content/tests/src/Kernel/Migrate/MigrateBlockContentTypeTest.php
  3. 11.x core/modules/block_content/tests/src/Kernel/Migrate/MigrateBlockContentTypeTest.php

Namespace

Drupal\Tests\block_content\Kernel\Migrate

File

core/modules/block_content/tests/src/Kernel/Migrate/MigrateBlockContentTypeTest.php

View source
<?php

namespace Drupal\Tests\block_content\Kernel\Migrate;

use Drupal\block_content\BlockContentTypeInterface;
use Drupal\block_content\Entity\BlockContentType;
use Drupal\Tests\migrate_drupal\Kernel\d7\MigrateDrupal7TestBase;

/**
 * Tests migration of the basic block content type.
 *
 * @group block_content
 */
class MigrateBlockContentTypeTest extends MigrateDrupal7TestBase {
    public static $modules = [
        'block',
        'block_content',
        'filter',
        'text',
    ];
    
    /**
     * {@inheritdoc}
     */
    protected function setUp() {
        parent::setUp();
        $this->installEntitySchema('block_content');
        $this->installConfig([
            'block_content',
        ]);
        $this->executeMigration('block_content_type');
    }
    
    /**
     * Tests the block content type migration.
     */
    public function testBlockContentTypeMigration() {
        
        /** @var \Drupal\block_content\BlockContentTypeInterface $entity */
        $entity = BlockContentType::load('basic');
        $this->assertInstanceOf(BlockContentTypeInterface::class, $entity);
        $this->assertIdentical('Basic', $entity->label());
    }

}

Classes

Title Deprecated Summary
MigrateBlockContentTypeTest Tests migration of the basic block content type.

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