You are here

public function ConfigDependencyTest::testNonEntity in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/config/src/Tests/ConfigDependencyTest.php \Drupal\config\Tests\ConfigDependencyTest::testNonEntity()

Tests that calculating dependencies for system module.

File

core/modules/config/src/Tests/ConfigDependencyTest.php, line 32
Contains \Drupal\config\Tests\ConfigDependencyTest.

Class

ConfigDependencyTest
Tests for configuration dependencies.

Namespace

Drupal\config\Tests

Code

public function testNonEntity() {
  $this
    ->installConfig(array(
    'system',
  ));
  $config_manager = \Drupal::service('config.manager');
  $dependents = $config_manager
    ->findConfigEntityDependents('module', array(
    '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::findConfigEntityDependentsAsEntities()
  // does not try to load system.site as an entity.
  $config_manager
    ->findConfigEntityDependentsAsEntities('module', array(
    'system',
  ));
}