function InstallConfiguratorTest::testDependenciesAreAutomaticallyIncluded

Same name and namespace in other branches
  1. 10 core/tests/Drupal/KernelTests/Core/Recipe/InstallConfiguratorTest.php \Drupal\KernelTests\Core\Recipe\InstallConfiguratorTest::testDependenciesAreAutomaticallyIncluded()

File

core/tests/Drupal/KernelTests/Core/Recipe/InstallConfiguratorTest.php, line 18

Class

InstallConfiguratorTest
@covers <a href="/api/drupal/core%21lib%21Drupal%21Core%21Recipe%21InstallConfigurator.php/class/InstallConfigurator/11.x" title="@internal This API is experimental." class="local">\Drupal\Core\Recipe\InstallConfigurator</a> @group Recipe

Namespace

Drupal\KernelTests\Core\Recipe

Code

public function testDependenciesAreAutomaticallyIncluded() : void {
    $configurator = new InstallConfigurator([
        'node',
        'test_theme_depending_on_modules',
    ], $this->container
        ->get(ModuleExtensionList::class), $this->container
        ->get(ThemeExtensionList::class));
    // Node and its dependencies should be listed.
    $this->assertContains('node', $configurator->modules);
    $this->assertContains('text', $configurator->modules);
    $this->assertContains('field', $configurator->modules);
    $this->assertContains('filter', $configurator->modules);
    // The test theme, along with its module AND theme dependencies, should be
    // listed.
    $this->assertContains('test_theme_depending_on_modules', $configurator->themes);
    $this->assertContains('test_module_required_by_theme', $configurator->modules);
    $this->assertContains('test_another_module_required_by_theme', $configurator->modules);
    $this->assertContains('stark', $configurator->themes);
}

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