You are here

protected function ImportExportTestBase::loadByUuid in Acquia Content Hub 8.2

Loads an entity of a given type by UUID.

Parameters

string $entity_type: The entity type.

string $uuid: The UUID.

Return value

\Drupal\Core\Entity\EntityInterface|bool The entity (if any).

Throws

\Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException

\Drupal\Component\Plugin\Exception\PluginNotFoundException

2 calls to ImportExportTestBase::loadByUuid()
RedirectImportExportTest::assertNodeRevisionCount in tests/src/Kernel/RedirectImportExportTest.php
Check if nodes with circular dependencies have no stub revisions created.
RedirectImportExportTest::testExceptionOnRedirectImport in tests/src/Kernel/RedirectImportExportTest.php
Tests if stubs are cleaned when there's an exception importing redirects.

File

tests/src/Kernel/ImportExportTestBase.php, line 659

Class

ImportExportTestBase
Base for testing exports and imports.

Namespace

Drupal\Tests\acquia_contenthub\Kernel

Code

protected function loadByUuid(string $entity_type, string $uuid) {
  return current($this->entityTypeManager
    ->getStorage($entity_type)
    ->loadByProperties([
    'uuid' => $uuid,
  ]));
}