public function ModuleInstallerTest::testDeprecatedInstall in Drupal 10
Tests trying to install a deprecated module.
@covers ::install
@group legacy
File
- core/
tests/ Drupal/ KernelTests/ Core/ Extension/ ModuleInstallerTest.php, line 156
Class
- ModuleInstallerTest
- Tests the ModuleInstaller class.
Namespace
Drupal\KernelTests\Core\ExtensionCode
public function testDeprecatedInstall() {
$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'));
}