function MigrateCommentTypeTest::assertEntity

Same name in this branch
  1. 11.x core/modules/comment/tests/src/Kernel/Migrate/d6/MigrateCommentTypeTest.php \Drupal\Tests\comment\Kernel\Migrate\d6\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. 9 core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentTypeTest.php \Drupal\Tests\comment\Kernel\Migrate\d7\MigrateCommentTypeTest::assertEntity()
  3. 8.9.x core/modules/comment/tests/src/Kernel/Migrate/d6/MigrateCommentTypeTest.php \Drupal\Tests\comment\Kernel\Migrate\d6\MigrateCommentTypeTest::assertEntity()
  4. 8.9.x core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentTypeTest.php \Drupal\Tests\comment\Kernel\Migrate\d7\MigrateCommentTypeTest::assertEntity()
  5. 10 core/modules/comment/tests/src/Kernel/Migrate/d6/MigrateCommentTypeTest.php \Drupal\Tests\comment\Kernel\Migrate\d6\MigrateCommentTypeTest::assertEntity()
  6. 10 core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentTypeTest.php \Drupal\Tests\comment\Kernel\Migrate\d7\MigrateCommentTypeTest::assertEntity()

Asserts a comment type entity.

@internal

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/d7/MigrateCommentTypeTest.php
Tests the migrated comment types.

File

core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentTypeTest.php, line 33

Class

MigrateCommentTypeTest
Tests the migration of comment types from Drupal 7.

Namespace

Drupal\Tests\comment\Kernel\Migrate\d7

Code

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

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.