protected function MigrateCommentFieldTest::assertEntity in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/modules/comment/src/Tests/Migrate/d7/MigrateCommentFieldTest.php \Drupal\comment\Tests\Migrate\d7\MigrateCommentFieldTest::assertEntity()
Asserts a comment field entity.
Parameters
string $id: The entity ID.
string $comment_type: The comment type (bundle ID) the field references.
1 call to MigrateCommentFieldTest::assertEntity()
- MigrateCommentFieldTest::testMigration in core/
modules/ comment/ src/ Tests/ Migrate/ d7/ MigrateCommentFieldTest.php - Tests the migrated fields.
File
- core/
modules/ comment/ src/ Tests/ Migrate/ d7/ MigrateCommentFieldTest.php, line 45 - Contains \Drupal\comment\Tests\Migrate\d7\MigrateCommentFieldTest.
Class
- MigrateCommentFieldTest
- Tests creation of comment reference fields for each comment type defined in Drupal 7.
Namespace
Drupal\comment\Tests\Migrate\d7Code
protected function assertEntity($id, $comment_type) {
$entity = FieldStorageConfig::load($id);
$this
->assertTrue($entity instanceof FieldStorageConfigInterface);
/** @var \Drupal\field\FieldStorageConfigInterface $entity */
$this
->assertIdentical('node', $entity
->getTargetEntityTypeId());
$this
->assertIdentical('comment', $entity
->getType());
$this
->assertIdentical($comment_type, $entity
->getSetting('comment_type'));
}