You are here

protected function ConfigDependencyTest::getDependentIds in Drupal 9

Same name and namespace in other branches
  1. 8 core/tests/Drupal/KernelTests/Core/Config/ConfigDependencyTest.php \Drupal\KernelTests\Core\Config\ConfigDependencyTest::getDependentIds()
  2. 10 core/tests/Drupal/KernelTests/Core/Config/ConfigDependencyTest.php \Drupal\KernelTests\Core\Config\ConfigDependencyTest::getDependentIds()

Gets a list of identifiers from an array of configuration entities.

Parameters

\Drupal\Core\Config\Entity\ConfigEntityInterface[] $dependents: An array of configuration entities.

Return value

array An array with values of entity_type_id:ID

1 call to ConfigDependencyTest::getDependentIds()
ConfigDependencyTest::testDependencyManagement in core/tests/Drupal/KernelTests/Core/Config/ConfigDependencyTest.php
Tests creating dependencies on configuration entities.

File

core/tests/Drupal/KernelTests/Core/Config/ConfigDependencyTest.php, line 670

Class

ConfigDependencyTest
Tests for configuration dependencies.

Namespace

Drupal\KernelTests\Core\Config

Code

protected function getDependentIds(array $dependents) {
  $dependent_ids = [];
  foreach ($dependents as $dependent) {
    $dependent_ids[] = $dependent
      ->getEntityTypeId() . ':' . $dependent
      ->id();
  }
  return $dependent_ids;
}