You are here

protected function ThunderTestTrait::loadTermByUuid in Thunder 6.2.x

Same name and namespace in other branches
  1. 6.1.x tests/src/Traits/ThunderTestTrait.php \Drupal\Tests\thunder\Traits\ThunderTestTrait::loadTermByUuid()

Load term by UUID.

Parameters

string $uuid: The uuid.

Return value

\Drupal\taxonomy\TermInterface|false|null The term entity.

Throws

\Drupal\Core\Entity\EntityStorageException

14 calls to ThunderTestTrait::loadTermByUuid()
AccessUnpublishedTest::testAccessUnpublished in tests/src/FunctionalJavascript/Integration/AccessUnpublishedTest.php
Testing integration of "access_unpublished" module.
ArticleCreationTest::testCreateArticle in tests/src/FunctionalJavascript/ArticleCreationTest.php
Test Creation of Article.
ArticleCreationTest::testCreateArticleWithNoModeration in tests/src/FunctionalJavascript/ArticleCreationTest.php
Test Creation of Article without content moderation.
ArticleCreationTest::testModerationWorkflow in tests/src/FunctionalJavascript/ArticleCreationTest.php
Tests draft creation and that reverting to the default revision works.
ArticleSchedulerIntegration::testSchedulerAccess in tests/src/FunctionalJavascript/ArticleSchedulerIntegration.php
Test Creation of Article.

... See full list

File

tests/src/Traits/ThunderTestTrait.php, line 220

Class

ThunderTestTrait
Use this trait to reuse an existing database.

Namespace

Drupal\Tests\thunder\Traits

Code

protected function loadTermByUuid($uuid) {
  $term = \Drupal::getContainer()
    ->get('entity.repository')
    ->loadEntityByUuid('taxonomy_term', $uuid);
  assert($term instanceof TermInterface);
  return $term;
}