You are here

protected function MigrateCommentTypeTest::assertEntity in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 core/modules/comment/src/Tests/Migrate/d7/MigrateCommentTypeTest.php \Drupal\comment\Tests\Migrate\d7\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/src/Tests/Migrate/d7/MigrateCommentTypeTest.php
Tests the migrated comment types.

File

core/modules/comment/src/Tests/Migrate/d7/MigrateCommentTypeTest.php, line 44
Contains \Drupal\comment\Tests\Migrate\d7\MigrateCommentTypeTest.

Class

MigrateCommentTypeTest
Tests migration of comment types from Drupal 7.

Namespace

Drupal\comment\Tests\Migrate\d7

Code

protected function assertEntity($id, $label) {
  $entity = CommentType::load($id);
  $this
    ->assertTrue($entity instanceof CommentTypeInterface);

  /** @var \Drupal\comment\CommentTypeInterface $entity */
  $this
    ->assertIdentical($label, $entity
    ->label());
  $this
    ->assertIdentical('node', $entity
    ->getTargetEntityTypeId());
}