public function ModuleInstallerTest::testDependencyInvalidCoreInstall in Drupal 9
Same name and namespace in other branches
- 8 core/tests/Drupal/KernelTests/Core/Extension/ModuleInstallerTest.php \Drupal\KernelTests\Core\Extension\ModuleInstallerTest::testDependencyInvalidCoreInstall()
Tests install with a dependency with an invalid core version constraint.
@covers ::install
File
- core/tests/ Drupal/ KernelTests/ Core/ Extension/ ModuleInstallerTest.php, line 123 
Class
- ModuleInstallerTest
- Tests the ModuleInstaller class.
Namespace
Drupal\KernelTests\Core\ExtensionCode
public function testDependencyInvalidCoreInstall() {
  $this
    ->expectException(MissingDependencyException::class);
  $this
    ->expectExceptionMessage("Unable to install modules: module 'system_incompatible_core_version_dependencies_test'. Its dependency module 'system_core_incompatible_semver_test' is incompatible with this version of Drupal core.");
  $this->container
    ->get('module_installer')
    ->install([
    'system_incompatible_core_version_dependencies_test',
  ]);
}