You are here

protected function KernelTestBase::installConfig in Drupal 10

Same name and namespace in other branches
  1. 8 core/tests/Drupal/KernelTests/KernelTestBase.php \Drupal\KernelTests\KernelTestBase::installConfig()
  2. 9 core/tests/Drupal/KernelTests/KernelTestBase.php \Drupal\KernelTests\KernelTestBase::installConfig()

Installs default configuration for a given list of modules.

Parameters

string|string[] $modules: A module or list of modules for which to install default configuration.

Throws

\LogicException If any module in $modules is not enabled.

150 calls to KernelTestBase::installConfig()
ArgumentUidRevisionTest::setUp in core/modules/node/tests/src/Kernel/Views/ArgumentUidRevisionTest.php
ArgumentValidatorTermNameTest::testArgumentValidatorTermNameAccess in core/modules/taxonomy/tests/src/Kernel/Views/ArgumentValidatorTermNameTest.php
Tests the access checking in term name argument validator plugin.
BooleanFormatterTest::setUp in core/modules/field/tests/src/Kernel/Boolean/BooleanFormatterTest.php
CacheabilityMetadataConfigOverrideTest::setUp in core/tests/Drupal/KernelTests/Core/Config/CacheabilityMetadataConfigOverrideTest.php
CacheContextOptimizationTest::setUp in core/tests/Drupal/KernelTests/Core/Cache/CacheContextOptimizationTest.php

... See full list

File

core/tests/Drupal/KernelTests/KernelTestBase.php, line 698

Class

KernelTestBase
Base class for functional integration tests.

Namespace

Drupal\KernelTests

Code

protected function installConfig($modules) {
  foreach ((array) $modules as $module) {
    if (!$this->container
      ->get('module_handler')
      ->moduleExists($module)) {
      throw new \LogicException("{$module} module is not enabled.");
    }
    $this->container
      ->get('config.installer')
      ->installDefaultConfig('module', $module);
  }
}