protected function MigrateFieldInstanceTest::assertEntity in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/modules/field/src/Tests/Migrate/d7/MigrateFieldInstanceTest.php \Drupal\field\Tests\Migrate\d7\MigrateFieldInstanceTest::assertEntity()
Asserts various aspects of a field config entity.
Parameters
string $id: The entity ID in the form ENTITY_TYPE.BUNDLE.FIELD_NAME.
string $expected_label: The expected field label.
string $expected_field_type: The expected field type.
boolean $is_required: Whether or not the field is required.
1 call to MigrateFieldInstanceTest::assertEntity()
- MigrateFieldInstanceTest::testFieldInstances in core/
modules/ field/ src/ Tests/ Migrate/ d7/ MigrateFieldInstanceTest.php - Tests migrating D7 field instances to field_config entities.
File
- core/
modules/ field/ src/ Tests/ Migrate/ d7/ MigrateFieldInstanceTest.php, line 87 - Contains \Drupal\field\Tests\Migrate\d7\MigrateFieldInstanceTest.
Class
- MigrateFieldInstanceTest
- Migrates Drupal 7 field instances.
Namespace
Drupal\field\Tests\Migrate\d7Code
protected function assertEntity($id, $expected_label, $expected_field_type, $is_required) {
list($expected_entity_type, $expected_bundle, $expected_name) = explode('.', $id);
/** @var \Drupal\field\FieldConfigInterface $field */
$field = FieldConfig::load($id);
$this
->assertTrue($field instanceof FieldConfigInterface);
$this
->assertIdentical($expected_label, $field
->label());
$this
->assertIdentical($expected_field_type, $field
->getType());
$this
->assertIdentical($expected_entity_type, $field
->getTargetEntityTypeId());
$this
->assertIdentical($expected_bundle, $field
->getTargetBundle());
$this
->assertIdentical($expected_name, $field
->getName());
$this
->assertEqual($is_required, $field
->isRequired());
$this
->assertIdentical($expected_entity_type . '.' . $expected_name, $field
->getFieldStorageDefinition()
->id());
}