MigrateBlockContentTypeTest.php

Same filename in other branches
  1. 9 core/modules/block_content/tests/src/Kernel/Migrate/MigrateBlockContentTypeTest.php
  2. 8.9.x 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

declare (strict_types=1);
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 {
    
    /**
     * {@inheritdoc}
     */
    protected static $modules = [
        'block',
        'block_content',
        'filter',
        'text',
    ];
    
    /**
     * {@inheritdoc}
     */
    protected function setUp() : void {
        parent::setUp();
        $this->installEntitySchema('block_content');
        $this->installConfig([
            'block_content',
        ]);
        $this->executeMigration('block_content_type');
    }
    
    /**
     * Tests the block content type migration.
     */
    public function testBlockContentTypeMigration() : void {
        
        /** @var \Drupal\block_content\BlockContentTypeInterface $entity */
        $entity = BlockContentType::load('basic');
        $this->assertInstanceOf(BlockContentTypeInterface::class, $entity);
        $this->assertSame('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.