class MigrateCommentFieldTest
Same name in this branch
- 9 core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentFieldTest.php \Drupal\Tests\comment\Kernel\Migrate\d7\MigrateCommentFieldTest
Same name and namespace in other branches
- 11.x core/modules/comment/tests/src/Kernel/Migrate/d6/MigrateCommentFieldTest.php \Drupal\Tests\comment\Kernel\Migrate\d6\MigrateCommentFieldTest
- 11.x core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentFieldTest.php \Drupal\Tests\comment\Kernel\Migrate\d7\MigrateCommentFieldTest
- 10 core/modules/comment/tests/src/Kernel/Migrate/d6/MigrateCommentFieldTest.php \Drupal\Tests\comment\Kernel\Migrate\d6\MigrateCommentFieldTest
- 10 core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentFieldTest.php \Drupal\Tests\comment\Kernel\Migrate\d7\MigrateCommentFieldTest
- 8.9.x core/modules/comment/tests/src/Kernel/Migrate/d6/MigrateCommentFieldTest.php \Drupal\Tests\comment\Kernel\Migrate\d6\MigrateCommentFieldTest
- 8.9.x core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentFieldTest.php \Drupal\Tests\comment\Kernel\Migrate\d7\MigrateCommentFieldTest
Tests the migration of comment fields from Drupal 6.
@group comment @group migrate_drupal_6
Hierarchy
- class \Drupal\KernelTests\KernelTestBase extends \Drupal\Core\DependencyInjection\ServiceProviderInterface uses \Drupal\KernelTests\AssertLegacyTrait, \Drupal\KernelTests\AssertContentTrait, \Drupal\Tests\RandomGeneratorTrait, \Drupal\Tests\ConfigTestTrait, \Drupal\Tests\ExtensionListTestTrait, \Drupal\Tests\TestRequirementsTrait, \Drupal\Tests\Traits\PhpUnitWarnings, \Drupal\Tests\PhpUnitCompatibilityTrait, \Symfony\Bridge\PhpUnit\ExpectDeprecationTrait implements \PHPUnit\Framework\TestCase
- class \Drupal\Tests\migrate\Kernel\MigrateTestBase extends \Drupal\migrate\MigrateMessageInterface implements \Drupal\KernelTests\KernelTestBase
- class \Drupal\Tests\migrate_drupal\Kernel\MigrateDrupalTestBase implements \Drupal\Tests\migrate\Kernel\MigrateTestBase
- class \Drupal\Tests\migrate_drupal\Kernel\d6\MigrateDrupal6TestBase uses \Drupal\Tests\migrate_drupal\Traits\NodeMigrateTypeTestTrait implements \Drupal\Tests\migrate_drupal\Kernel\MigrateDrupalTestBase
- class \Drupal\Tests\comment\Kernel\Migrate\d6\MigrateCommentFieldTest implements \Drupal\Tests\migrate_drupal\Kernel\d6\MigrateDrupal6TestBase
- class \Drupal\Tests\migrate_drupal\Kernel\d6\MigrateDrupal6TestBase uses \Drupal\Tests\migrate_drupal\Traits\NodeMigrateTypeTestTrait implements \Drupal\Tests\migrate_drupal\Kernel\MigrateDrupalTestBase
- class \Drupal\Tests\migrate_drupal\Kernel\MigrateDrupalTestBase implements \Drupal\Tests\migrate\Kernel\MigrateTestBase
- class \Drupal\Tests\migrate\Kernel\MigrateTestBase extends \Drupal\migrate\MigrateMessageInterface implements \Drupal\KernelTests\KernelTestBase
Expanded class hierarchy of MigrateCommentFieldTest
File
-
core/
modules/ comment/ tests/ src/ Kernel/ Migrate/ d6/ MigrateCommentFieldTest.php, line 14
Namespace
Drupal\Tests\comment\Kernel\Migrate\d6View source
class MigrateCommentFieldTest extends MigrateDrupal6TestBase {
/**
* {@inheritdoc}
*/
protected static $modules = [
'comment',
'menu_ui',
];
/**
* {@inheritdoc}
*/
protected function setUp() : void {
parent::setUp();
$this->installConfig([
'comment',
]);
$this->executeMigrations([
'd6_comment_type',
'd6_comment_field',
]);
}
/**
* Asserts a comment field entity.
*
* @param string $comment_type
* The comment type.
*
* @internal
*/
protected function assertEntity(string $comment_type) : void {
$entity = FieldStorageConfig::load('node.' . $comment_type);
$this->assertInstanceOf(FieldStorageConfig::class, $entity);
$this->assertSame('node', $entity->getTargetEntityTypeId());
$this->assertSame('comment', $entity->getType());
$this->assertSame($comment_type, $entity->getSetting('comment_type'));
}
/**
* Tests the migrated comment fields.
*/
public function testMigration() {
$this->assertEntity('comment_node_article');
$this->assertEntity('comment_node_company');
$this->assertEntity('comment_node_employee');
$this->assertEntity('comment_node_event');
$this->assertEntity('comment_forum');
$this->assertEntity('comment_node_page');
$this->assertEntity('comment_node_sponsor');
$this->assertEntity('comment_node_story');
$this->assertEntity('comment_node_test_event');
$this->assertEntity('comment_node_test_page');
$this->assertEntity('comment_node_test_planet');
$this->assertEntity('comment_node_test_story');
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.