public function ModuleInstallerTest::testKernelRebuildDuringHookInstall in Drupal 10
Same name and namespace in other branches
- 8 core/tests/Drupal/KernelTests/Core/Extension/ModuleInstallerTest.php \Drupal\KernelTests\Core\Extension\ModuleInstallerTest::testKernelRebuildDuringHookInstall()
- 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\ExtensionCode
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',
]));
}