function ModuleInstallerTest::testDeprecatedInstall

Same name in other branches
  1. 9 core/tests/Drupal/KernelTests/Core/Extension/ModuleInstallerTest.php \Drupal\KernelTests\Core\Extension\ModuleInstallerTest::testDeprecatedInstall()
  2. 10 core/tests/Drupal/KernelTests/Core/Extension/ModuleInstallerTest.php \Drupal\KernelTests\Core\Extension\ModuleInstallerTest::testDeprecatedInstall()

Tests trying to install a deprecated module.

@covers ::install

@group legacy

File

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

Class

ModuleInstallerTest
Tests the ModuleInstaller class.

Namespace

Drupal\KernelTests\Core\Extension

Code

public function testDeprecatedInstall() : void {
    $this->expectDeprecation("The module 'deprecated_module' is deprecated. See http://example.com/deprecated");
    \Drupal::service('module_installer')->install([
        'deprecated_module',
    ]);
    $this->assertTrue(\Drupal::service('module_handler')->moduleExists('deprecated_module'));
}

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