protected function MigrateUiParagraphsTestBase::getEntityStorage

Returns the specified entity's storage when the entity definition exists.

Parameters

string $entity_type_id: The entity type ID.

Return value

\Drupal\Core\Entity\EntityStorageInterface|null The embed button's entity storage, or NULL if it does not exist.

1 call to MigrateUiParagraphsTestBase::getEntityStorage()
MigrateUiParagraphsTestBase::assertEntities in paragraphs/tests/src/Functional/Migrate/MigrateUiParagraphsTestBase.php
Asserts that the expected entities exist.

File

paragraphs/tests/src/Functional/Migrate/MigrateUiParagraphsTestBase.php, line 541

Class

MigrateUiParagraphsTestBase
Provides a base class for testing Paragraphs migration via the UI.

Namespace

Drupal\Tests\paragraphs\Functional\Migrate

Code

protected function getEntityStorage(string $entity_type_id) {
  $entity_type_manager = $this->container
    ->get('entity_type.manager');
  assert($entity_type_manager instanceof EntityTypeManagerInterface);
  try {
    $storage = $entity_type_manager
      ->getStorage($entity_type_id);
  } catch (PluginNotFoundException $e) {

    // The entity type does not exist.
    return NULL;
  }
  return $storage;
}