You are here

protected function MigrateCommentTypeTest::assertEntity in Drupal 8

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

Asserts a comment type entity.

Parameters

string $id: The entity ID.

string $label: The entity label.

1 call to MigrateCommentTypeTest::assertEntity()
MigrateCommentTypeTest::testMigration in core/modules/comment/tests/src/Kernel/Migrate/d6/MigrateCommentTypeTest.php
Tests the migrated comment types.

File

core/modules/comment/tests/src/Kernel/Migrate/d6/MigrateCommentTypeTest.php, line 38

Class

MigrateCommentTypeTest
Tests the migration of comment types from Drupal 6.

Namespace

Drupal\Tests\comment\Kernel\Migrate\d6

Code

protected function assertEntity($id, $label) {
  $entity = CommentType::load($id);
  $this
    ->assertInstanceOf(CommentType::class, $entity);
  $this
    ->assertSame($label, $entity
    ->label());
  $this
    ->assertSame('node', $entity
    ->getTargetEntityTypeId());
}