protected function MigrateCommentFieldInstanceTest::assertEntity in Drupal 8
Same name in this branch
- 8 core/modules/comment/tests/src/Kernel/Migrate/d6/MigrateCommentFieldInstanceTest.php \Drupal\Tests\comment\Kernel\Migrate\d6\MigrateCommentFieldInstanceTest::assertEntity()
- 8 core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentFieldInstanceTest.php \Drupal\Tests\comment\Kernel\Migrate\d7\MigrateCommentFieldInstanceTest::assertEntity()
Same name and namespace in other branches
- 9 core/modules/comment/tests/src/Kernel/Migrate/d6/MigrateCommentFieldInstanceTest.php \Drupal\Tests\comment\Kernel\Migrate\d6\MigrateCommentFieldInstanceTest::assertEntity()
Asserts a comment field instance entity.
Parameters
string $bundle: The bundle ID.
string $field_name: The field name.
int $default_value: The field's default_value setting.
int $default_mode: The field's default_mode setting.
int $per_page: The field's per_page setting.
bool $anonymous: The field's anonymous setting.
int $form_location: The field's form_location setting.
bool $preview: The field's preview setting.
1 call to MigrateCommentFieldInstanceTest::assertEntity()
- MigrateCommentFieldInstanceTest::testMigration in core/
modules/ comment/ tests/ src/ Kernel/ Migrate/ d6/ MigrateCommentFieldInstanceTest.php - Test the migrated field instance values.
File
- core/
modules/ comment/ tests/ src/ Kernel/ Migrate/ d6/ MigrateCommentFieldInstanceTest.php, line 55
Class
- MigrateCommentFieldInstanceTest
- Tests the migration of comment field instances from Drupal 6.
Namespace
Drupal\Tests\comment\Kernel\Migrate\d6Code
protected function assertEntity($bundle, $field_name, $default_value, $default_mode, $per_page, $anonymous, $form_location, $preview) {
$entity = FieldConfig::load("node.{$bundle}.{$field_name}");
$this
->assertInstanceOf(FieldConfig::class, $entity);
$this
->assertSame('node', $entity
->getTargetEntityTypeId());
$this
->assertSame('Comments', $entity
->label());
$this
->assertTrue($entity
->isRequired());
$this
->assertSame($bundle, $entity
->getTargetBundle());
$this
->assertSame($field_name, $entity
->getFieldStorageDefinition()
->getName());
$this
->assertSame($default_value, $entity
->get('default_value')[0]['status']);
$this
->assertSame($default_mode, $entity
->getSetting('default_mode'));
$this
->assertSame($per_page, $entity
->getSetting('per_page'));
$this
->assertSame($anonymous, $entity
->getSetting('anonymous'));
$this
->assertSame($form_location, $entity
->getSetting('form_location'));
$this
->assertSame($preview, $entity
->getSetting('preview'));
}