You are here

protected function StableTemplateOverrideTest::installAllModules in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/tests/Drupal/KernelTests/Core/Theme/StableTemplateOverrideTest.php \Drupal\KernelTests\Core\Theme\StableTemplateOverrideTest::installAllModules()

Installs all core modules.

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

File

core/tests/Drupal/KernelTests/Core/Theme/StableTemplateOverrideTest.php, line 64
Contains \Drupal\KernelTests\Core\Theme\StableTemplateOverrideTest.

Class

StableTemplateOverrideTest
Tests Stable's template overrides.

Namespace

Drupal\KernelTests\Core\Theme

Code

protected function installAllModules() {

  // Needed for system_rebuild_module_data().
  include_once $this->root . '/core/modules/system/system.module';

  // Enable all core modules.
  $all_modules = system_rebuild_module_data();
  $all_modules = array_filter($all_modules, function ($module) {

    // Filter contrib, hidden, already enabled modules and modules in the
    // Testing package.
    if ($module->origin !== 'core' || !empty($module->info['hidden']) || $module->status == TRUE || $module->info['package'] == 'Testing') {
      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',
  ]);
}