You are here

protected function MigrateCommentFieldTest::assertEntity in Drupal 8

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

Asserts a comment field entity.

Parameters

string $comment_type: The comment type.

1 call to MigrateCommentFieldTest::assertEntity()
MigrateCommentFieldTest::testMigration in core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentFieldTest.php
Tests the migrated comment fields.

File

core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentFieldTest.php, line 36

Class

MigrateCommentFieldTest
Tests the migration of comment fields from Drupal 7.

Namespace

Drupal\Tests\comment\Kernel\Migrate\d7

Code

protected function assertEntity($comment_type) {
  $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'));
}