You are here

protected function Stable9TemplateOverrideTest::installAllModules in Drupal 9

Installs all core modules.

1 call to Stable9TemplateOverrideTest::installAllModules()
Stable9TemplateOverrideTest::setUp in core/tests/Drupal/KernelTests/Core/Theme/Stable9TemplateOverrideTest.php

File

core/tests/Drupal/KernelTests/Core/Theme/Stable9TemplateOverrideTest.php, line 61

Class

Stable9TemplateOverrideTest
Tests Stable 9's template overrides.

Namespace

Drupal\KernelTests\Core\Theme

Code

protected function installAllModules() {

  // Enable all core modules.
  $all_modules = $this->container
    ->get('extension.list.module')
    ->getList();
  $all_modules = array_filter($all_modules, function ($module) {

    // Filter contrib, hidden, experimental, already enabled modules, and
    // modules in the Testing package.
    if ($module->origin !== 'core' || !empty($module->info['hidden']) || $module->status == TRUE || $module->info['package'] == 'Testing' || $module->info[ExtensionLifecycle::LIFECYCLE_IDENTIFIER] === ExtensionLifecycle::EXPERIMENTAL) {
      return FALSE;
    }
    return TRUE;
  });
  $this->allModules = array_keys($all_modules);
  sort($this->allModules);
  $module_installer = $this->container
    ->get('module_installer');
  $module_installer
    ->install($this->allModules);
  $this
    ->installConfig([
    'system',
    'user',
  ]);
}