function ModuleInstallerTest::testObsoleteInstall

Same name in other branches
  1. 9 core/tests/Drupal/KernelTests/Core/Extension/ModuleInstallerTest.php \Drupal\KernelTests\Core\Extension\ModuleInstallerTest::testObsoleteInstall()
  2. 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 147

Class

ModuleInstallerTest
Tests the ModuleInstaller class.

Namespace

Drupal\KernelTests\Core\Extension

Code

public function testObsoleteInstall() : void {
    $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',
    ]);
}

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