You are here

protected function ToolbarCacheContextsTest::installExtraModules in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/toolbar/src/Tests/ToolbarCacheContextsTest.php \Drupal\toolbar\Tests\ToolbarCacheContextsTest::installExtraModules()

Installs a given list of modules and rebuilds the cache.

Parameters

string[] $module_list: An array of module names.

1 call to ToolbarCacheContextsTest::installExtraModules()
ToolbarCacheContextsTest::testToolbarCacheContextsCaller in core/modules/toolbar/src/Tests/ToolbarCacheContextsTest.php
Tests toolbar cache contexts.

File

core/modules/toolbar/src/Tests/ToolbarCacheContextsTest.php, line 143
Contains \Drupal\toolbar\Tests\ToolbarCacheContextsTest.

Class

ToolbarCacheContextsTest
Tests the cache contexts for toolbar.

Namespace

Drupal\toolbar\Tests

Code

protected function installExtraModules(array $module_list) {
  \Drupal::service('module_installer')
    ->install($module_list);

  // Installing modules updates the container and needs a router rebuild.
  $this->container = \Drupal::getContainer();
  $this->container
    ->get('router.builder')
    ->rebuildIfNeeded();
}