function ThemesNotUsingClassyTemplatesTest::installAllModules

Installs all core modules.

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

File

core/tests/Drupal/KernelTests/Core/Theme/ThemesNotUsingClassyTemplatesTest.php, line 95

Class

ThemesNotUsingClassyTemplatesTest
Tests that themes do not depend on Classy templates.

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['package'] === 'Core (Experimental)') {
            return FALSE;
        }
        return TRUE;
    });
    $all_modules = array_keys($all_modules);
    $module_installer = $this->container
        ->get('module_installer');
    $module_installer->install($all_modules);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.