You are here

public function ModuleInstallerTest::testObsoleteInstall in Drupal 9

Same name and namespace in other branches
  1. 10 core/tests/Drupal/KernelTests/Core/Extension/ModuleInstallerTest.php \Drupal\KernelTests\Core\Extension\ModuleInstallerTest::testObsoleteInstall()

Tests trying to install an obsolete module.

@covers ::install

File

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

Class

ModuleInstallerTest
Tests the ModuleInstaller class.

Namespace

Drupal\KernelTests\Core\Extension

Code

public function testObsoleteInstall() {
  $this
    ->expectException(ObsoleteExtensionException::class);
  $this
    ->expectExceptionMessage("Unable to install modules: module 'system_status_obsolete_test' is obsolete.");
  $this->container
    ->get('module_installer')
    ->install([
    'system_status_obsolete_test',
  ]);
}