class InstallerDependenciesResolutionTest

Same name and namespace in other branches
  1. 11.x core/modules/system/tests/src/Kernel/Installer/InstallerDependenciesResolutionTest.php \Drupal\Tests\system\Kernel\Installer\InstallerDependenciesResolutionTest
  2. 10 core/modules/system/tests/src/Kernel/Installer/InstallerDependenciesResolutionTest.php \Drupal\Tests\system\Kernel\Installer\InstallerDependenciesResolutionTest
  3. 8.9.x core/modules/system/tests/src/Kernel/Installer/InstallerDependenciesResolutionTest.php \Drupal\Tests\system\Kernel\Installer\InstallerDependenciesResolutionTest

Tests that we handle module dependency resolution during install.

@group Installer

Hierarchy

Expanded class hierarchy of InstallerDependenciesResolutionTest

File

core/modules/system/tests/src/Kernel/Installer/InstallerDependenciesResolutionTest.php, line 13

Namespace

Drupal\Tests\system\Kernel\Installer
View source
class InstallerDependenciesResolutionTest extends KernelTestBase {
  
  /**
   * {@inheritdoc}
   */
  protected static $modules = [
    'system',
  ];
  
  /**
   * Verifies that the exception message in the profile step is correct.
   */
  public function testDependenciesResolution() {
    // Prime the \Drupal\Core\Extension\ExtensionList::getPathname static cache
    // with the location of the testing profile as it is not the currently
    // active profile and we don't yet have any cached way to retrieve its
    // location.
    // @todo Remove as part of https://www.drupal.org/node/2186491
    $profile_list = \Drupal::service('extension.list.profile');
    assert($profile_list instanceof ProfileExtensionList);
    $profile_list->setPathname('testing_missing_dependencies', 'core/profiles/testing_missing_dependencies/testing_missing_dependencies.info.yml');
    $info = drupal_verify_profile([
      'parameters' => [
        'profile' => 'testing_missing_dependencies',
      ],
      'profile_info' => install_profile_info('testing_missing_dependencies'),
    ]);
    $message = $info['required_modules']['description']->render();
    $this->assertStringContainsString('Fictional', $message);
    $this->assertStringContainsString('Missing_module1', $message);
    $this->assertStringContainsString('Missing_module2', $message);
    $this->assertStringNotContainsString('Block', $message);
    $this->assertStringNotContainsString('Node', $message);
  }

}

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