You are here

public function ConfigDependencyTest::testNonEntity in Drupal 10

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

Tests that calculating dependencies for system module.

File

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

Class

ConfigDependencyTest
Tests for configuration dependencies.

Namespace

Drupal\KernelTests\Core\Config

Code

public function testNonEntity() {
  $this
    ->installConfig([
    'system',
  ]);
  $config_manager = \Drupal::service('config.manager');
  $dependents = $config_manager
    ->findConfigEntityDependencies('module', [
    'system',
  ]);
  $this
    ->assertTrue(isset($dependents['system.site']), 'Simple configuration system.site has a UUID key even though it is not a configuration entity and therefore is found when looking for dependencies of the System module.');

  // Ensure that calling
  // \Drupal\Core\Config\ConfigManager::findConfigEntityDependenciesAsEntities()
  // does not try to load system.site as an entity.
  $config_manager
    ->findConfigEntityDependenciesAsEntities('module', [
    'system',
  ]);
}