function GitExcluderTest::setUp

Overrides PackageManagerKernelTestBase::setUp

File

core/modules/package_manager/tests/src/Kernel/PathExcluder/GitExcluderTest.php, line 28

Class

GitExcluderTest
@covers \Drupal\package_manager\PathExcluder\GitExcluder @group package_manager @internal

Namespace

Drupal\Tests\package_manager\Kernel\PathExcluder

Code

protected function setUp() : void {
    parent::setUp();
    $project_root = $this->container
        ->get(PathLocator::class)
        ->getProjectRoot();
    $this->installComposerInstallers($project_root);
    $active_manipulator = new ActiveFixtureManipulator();
    $active_manipulator->addPackage([
        'name' => 'foo/package_known_to_composer_removed_later',
        'type' => 'drupal-module',
        'version' => '1.0.0',
    ], FALSE, TRUE)
        ->addPackage([
        'name' => 'foo/custom_package_known_to_composer',
        'type' => 'drupal-custom-module',
        'version' => '1.0.0',
    ], FALSE, TRUE)
        ->addPackage([
        'name' => 'foo/package_with_different_installer_path_known_to_composer',
        'type' => 'drupal-module',
        'version' => '1.0.0',
    ], FALSE, TRUE);
    // Set the installer path config in the project root where we install the
    // package.
    $installer_paths['different_installer_path/package_known_to_composer'] = [
        'foo/package_with_different_installer_path_known_to_composer',
    ];
    $this->setInstallerPaths($installer_paths, $project_root);
    $active_manipulator->addProjectAtPath("modules/module_not_known_to_composer_in_active")
        ->addDotGitFolder($project_root . "/modules/module_not_known_to_composer_in_active")
        ->addDotGitFolder($project_root . "/modules/contrib/package_known_to_composer_removed_later")
        ->addDotGitFolder($project_root . "/modules/custom/custom_package_known_to_composer")
        ->addDotGitFolder($project_root . "/different_installer_path/package_known_to_composer")
        ->commitChanges();
}

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