You are here

protected function KernelTestBase::installConfig in Zircon Profile 8.0

Same name in this branch
  1. 8.0 core/tests/Drupal/KernelTests/KernelTestBase.php \Drupal\KernelTests\KernelTestBase::installConfig()
  2. 8.0 core/modules/simpletest/src/KernelTestBase.php \Drupal\simpletest\KernelTestBase::installConfig()
Same name and namespace in other branches
  1. 8 core/tests/Drupal/KernelTests/KernelTestBase.php \Drupal\KernelTests\KernelTestBase::installConfig()

Installs default configuration for a given list of modules.

Parameters

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

Throws

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

6 calls to KernelTestBase::installConfig()
DefaultConfigTest::testModuleConfig in core/tests/Drupal/KernelTests/Config/DefaultConfigTest.php
Tests if installed config is equal to the exported config.
EntitySerializationTest::setUp in core/modules/serialization/src/Tests/EntitySerializationTest.php
KernelTestBaseTest::testCompiledContainer in core/tests/Drupal/KernelTests/KernelTestBaseTest.php
@covers ::getCompiledContainerBuilder
KernelTestBaseTest::testCompiledContainerIsDestructed in core/tests/Drupal/KernelTests/KernelTestBaseTest.php
@covers ::getCompiledContainerBuilder @depends testCompiledContainer
NormalizerTestBase::setUp in core/modules/serialization/src/Tests/NormalizerTestBase.php

... See full list

File

core/tests/Drupal/KernelTests/KernelTestBase.php, line 711
Contains \Drupal\KernelTests\KernelTestBase.

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);
  }
}