You are here

public function MigrateEckFieldInstanceTest::testFieldInstances in Entity Construction Kit (ECK) 8

Tests migrating D7 field instances to field_config entities.

File

tests/src/Kernel/Migrate/d7/MigrateEckFieldInstanceTest.php, line 66

Class

MigrateEckFieldInstanceTest
Migrates Drupal 7 field instances.

Namespace

Drupal\Tests\eck\Kernel\Migrate\d7

Code

public function testFieldInstances() {
  $this
    ->assertFieldInstance('complex_entity.complex_entity.field_complex_entity', 'Complex entity', 'entity_reference', FALSE, FALSE);
  $this
    ->assertFieldInstance('complex_entity.complex_entity.field_node', 'Node', 'entity_reference', TRUE, FALSE);
  $this
    ->assertFieldInstance('complex_entity.complex_entity.field_simple_entities', 'Simple entities', 'entity_reference', FALSE, FALSE);
  $this
    ->assertFieldInstance('complex_entity.complex_entity.field_text', 'Text', 'string', TRUE, TRUE);
  $this
    ->assertFieldInstance('simple_entity.simple_entity.field_text', 'Text', 'string', FALSE, TRUE);
  $this
    ->assertFieldInstance('node.article.body', 'Body', 'text_with_summary', FALSE, FALSE);
  $this
    ->assertEntityReferenceFields('complex_entity.complex_entity.field_complex_entity', NULL);
  $this
    ->assertEntityReferenceFields('complex_entity.complex_entity.field_node', NULL);
  $this
    ->assertEntityReferenceFields('complex_entity.complex_entity.field_simple_entities', [
    'simple_entity',
  ]);
}