You are here

protected function ParagraphsMigrationTestBase::assertParagraphFieldExists in Paragraphs 8

Check if a field storage entity was created for the paragraph fields.

Parameters

string $entity_type: The entity type to check on.

string $field_name: The field name to check for.

1 call to ParagraphsMigrationTestBase::assertParagraphFieldExists()
ParagraphsFieldMigrationTest::testParagraphsFieldMigration in tests/src/Kernel/migrate/ParagraphsFieldMigrationTest.php
Test that the paragraph and field collection field storage was migrated.

File

tests/src/Kernel/migrate/ParagraphsMigrationTestBase.php, line 71

Class

ParagraphsMigrationTestBase
Base class for the paragraph migrations tests.

Namespace

Drupal\Tests\paragraphs\Kernel\migrate

Code

protected function assertParagraphFieldExists($entity_type, $field_name) {
  $field_storage = FieldStorageConfig::loadByName($entity_type, $field_name);
  $this
    ->assertNotNull($field_storage);
  $this
    ->assertEquals('entity_reference_revisions', $field_storage
    ->getType());
  $this
    ->assertEquals('paragraph', $field_storage
    ->getSetting('target_type'));
}