function ModuleInstallerTest::testContainerRebuildRequired

Tests container rebuilding due to the container_rebuild_required info key.

@legacy-covers ::install

Attributes

#[DataProvider('containerRebuildRequiredProvider')]

Parameters

array $modules: The modules to install.

int $count: The number of times the container should have been rebuilt.

File

core/tests/Drupal/KernelTests/Core/Extension/ModuleInstallerTest.php, line 188

Class

ModuleInstallerTest
Tests the ModuleInstaller class.

Namespace

Drupal\KernelTests\Core\Extension

Code

public function testContainerRebuildRequired(array $modules, int $count) : void {
  $this->container
    ->get('module_installer')
    ->install([
    'module_test',
  ]);
  $GLOBALS['container_rebuilt'] = 0;
  $this->container
    ->get('module_installer')
    ->install($modules);
  $this->assertSame($count, $GLOBALS['container_rebuilt']);
}

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