You are here

protected function ThunderTestTrait::loadNodeByUuid 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::loadNodeByUuid()

Load node by UUID.

Parameters

string $uuid: The uuid.

Return value

\Drupal\node\NodeInterface|false|null The node entity.

Throws

\Drupal\Core\Entity\EntityStorageException

11 calls to ThunderTestTrait::loadNodeByUuid()
AutosaveFormTest::testAutosaveInExistingEntity in tests/src/FunctionalJavascript/Integration/AutosaveFormTest.php
Tests the autosave functionality in an existing article.
BreadcrumbTest::testBreadCrumbs in tests/src/Functional/BreadcrumbTest.php
Tests breadcrumbs on node and administrative paths.
EntityReferenceActionsTest::testMediaEditInArticle in tests/src/FunctionalJavascript/Integration/EntityReferenceActionsTest.php
Test editing of media items in an embedded gallery.
InlineEntityFormTest::testGalleryCollapse in tests/src/FunctionalJavascript/Integration/InlineEntityFormTest.php
Test saving collapsed gallery paragraph.
MediaGalleryModifyTest::testAddRemove in tests/src/FunctionalJavascript/MediaGalleryModifyTest.php
Test add/remove Images in Gallery.

... See full list

File

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

Class

ThunderTestTrait
Use this trait to reuse an existing database.

Namespace

Drupal\Tests\thunder\Traits

Code

protected function loadNodeByUuid($uuid) {
  $node = \Drupal::getContainer()
    ->get('entity.repository')
    ->loadEntityByUuid('node', $uuid);
  assert($node instanceof NodeInterface);
  return $node;
}