You are here

protected function RabbitHoleBehaviorSettingsFormTestBase::loadEntity in Rabbit Hole 8

Same name and namespace in other branches
  1. 2.x tests/src/Functional/RabbitHoleBehaviorSettingsFormTestBase.php \Drupal\Tests\rabbit_hole\Functional\RabbitHoleBehaviorSettingsFormTestBase::loadEntity()

Loads test entity.

Parameters

mixed $id: ID of loaded entity.

Return value

\Drupal\Core\Entity\EntityInterface Loaded entity.

2 calls to RabbitHoleBehaviorSettingsFormTestBase::loadEntity()
RabbitHoleBehaviorSettingsFormTestBase::testExistingEntityNoConfigSave in tests/src/Functional/RabbitHoleBehaviorSettingsFormTestBase.php
Test saving settings for entity that did not previously have them.
RabbitHoleBehaviorSettingsFormTestBase::testExistingEntitySave in tests/src/Functional/RabbitHoleBehaviorSettingsFormTestBase.php
Test that existing entity is edited on saving the entity form.

File

tests/src/Functional/RabbitHoleBehaviorSettingsFormTestBase.php, line 334

Class

RabbitHoleBehaviorSettingsFormTestBase
Base class for the Rabbit Hole form additions tests.

Namespace

Drupal\Tests\rabbit_hole\Functional

Code

protected function loadEntity($id) {
  $storage = \Drupal::entityTypeManager()
    ->getStorage($this->entityType);
  $storage
    ->resetCache([
    $id,
  ]);
  return $storage
    ->load($id);
}