You are here

protected function DependencyCalculatorTest::getDependentEntityWrapper in Dependency Calculation 8

Calculate entity dependencies and return the DependentEntityWrapper object.

Parameters

\Drupal\Core\Entity\EntityInterface $entity: The entity object.

Return value

\Drupal\depcalc\DependentEntityWrapper The DependentEntityWrapper object.

Throws

\Exception

2 calls to DependencyCalculatorTest::getDependentEntityWrapper()
DependencyCalculatorTest::getEntityDependencies in tests/src/Kernel/DependencyCalculatorTest.php
Returns the list of entity dependencies.
DependencyCalculatorTest::getModuleDependencies in tests/src/Kernel/DependencyCalculatorTest.php
Returns the list of module dependencies.

File

tests/src/Kernel/DependencyCalculatorTest.php, line 185

Class

DependencyCalculatorTest
Class DependencyCalculatorTest.

Namespace

Drupal\Tests\depcalc\Kernel

Code

protected function getDependentEntityWrapper(EntityInterface $entity) : DependentEntityWrapper {
  if (isset($this->dependentEntityWrapper)) {
    return $this->dependentEntityWrapper;
  }
  $this->dependentEntityWrapper = new DependentEntityWrapper($entity);
  $stack = new DependencyStack();
  $this->calculator
    ->calculateDependencies($this->dependentEntityWrapper, $stack);
  return $this->dependentEntityWrapper;
}