You are here

public function ModuleInstallerTest::testKernelRebuildDuringHookInstall in Drupal 10

Same name and namespace in other branches
  1. 8 core/tests/Drupal/KernelTests/Core/Extension/ModuleInstallerTest.php \Drupal\KernelTests\Core\Extension\ModuleInstallerTest::testKernelRebuildDuringHookInstall()
  2. 9 core/tests/Drupal/KernelTests/Core/Extension/ModuleInstallerTest.php \Drupal\KernelTests\Core\Extension\ModuleInstallerTest::testKernelRebuildDuringHookInstall()

Ensure that rebuilding the container in hook_install() works.

File

core/tests/Drupal/KernelTests/Core/Extension/ModuleInstallerTest.php, line 84

Class

ModuleInstallerTest
Tests the ModuleInstaller class.

Namespace

Drupal\KernelTests\Core\Extension

Code

public function testKernelRebuildDuringHookInstall() {
  \Drupal::state()
    ->set('module_test_install:rebuild_container', TRUE);
  $module_installer = $this->container
    ->get('module_installer');
  $this
    ->assertTrue($module_installer
    ->install([
    'module_test',
  ]));
}