You are here

protected function ToolbarCacheContextsTest::installExtraModules in Drupal 9

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

Installs a given list of modules and rebuilds the cache.

Parameters

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

2 calls to ToolbarCacheContextsTest::installExtraModules()
ToolbarCacheContextsTest::testCacheIntegration in core/modules/toolbar/tests/src/Functional/ToolbarCacheContextsTest.php
Tests toolbar cache integration.
ToolbarCacheContextsTest::testToolbarCacheContextsCaller in core/modules/toolbar/tests/src/Functional/ToolbarCacheContextsTest.php
Tests toolbar cache contexts.

File

core/modules/toolbar/tests/src/Functional/ToolbarCacheContextsTest.php, line 138

Class

ToolbarCacheContextsTest
Tests the cache contexts for toolbar.

Namespace

Drupal\Tests\toolbar\Functional

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();
}