function BuildTestBase::copyCodebase

Same name in other branches
  1. 8.9.x core/tests/Drupal/BuildTests/Framework/BuildTestBase.php \Drupal\BuildTests\Framework\BuildTestBase::copyCodebase()
  2. 10 core/tests/Drupal/BuildTests/Framework/BuildTestBase.php \Drupal\BuildTests\Framework\BuildTestBase::copyCodebase()
  3. 11.x core/tests/Drupal/BuildTests/Framework/BuildTestBase.php \Drupal\BuildTests\Framework\BuildTestBase::copyCodebase()

Copy the current working codebase into a workspace.

Use this method to copy the current codebase, including any patched changes, into the workspace.

By default, the copy will exclude sites/default/settings.php, sites/default/files, and vendor/. Use the $iterator parameter to override this behavior.

Parameters

\Iterator|null $iterator: (optional) An iterator of all the files to copy. Default behavior is to exclude site-specific directories and files.

string|null $working_dir: (optional) Relative path within the test workspace file system that will contain the copy of the codebase. Defaults to the workspace directory.

9 calls to BuildTestBase::copyCodebase()
BuildTestTest::testCopyCodebase in core/tests/Drupal/BuildTests/Framework/Tests/BuildTestTest.php
@covers ::copyCodebase
BuildTestTest::testPortMany in core/tests/Drupal/BuildTests/Framework/Tests/BuildTestTest.php
@covers ::findAvailablePort
ComponentsIsolatedBuildTest::testComponentComposerJson in core/tests/Drupal/BuildTests/Composer/Component/ComponentsIsolatedBuildTest.php
Test whether components' composer.json can be installed in isolation.
ComponentsTaggedReleaseTest::testReleaseTagging in core/tests/Drupal/BuildTests/Composer/Component/ComponentsTaggedReleaseTest.php
Validate release tagging and regeneration of dependencies.
ComposerProjectTemplatesTest::testTemplateCreateProject in core/tests/Drupal/BuildTests/Composer/Template/ComposerProjectTemplatesTest.php
@dataProvider provideTemplateCreateProject

... See full list

File

core/tests/Drupal/BuildTests/Framework/BuildTestBase.php, line 560

Class

BuildTestBase
Provides a workspace to test build processes.

Namespace

Drupal\BuildTests\Framework

Code

public function copyCodebase(\Iterator $iterator = NULL, $working_dir = NULL) {
    $working_path = $this->getWorkingPath($working_dir);
    if ($iterator === NULL) {
        $iterator = $this->getCodebaseFinder()
            ->getIterator();
    }
    $fs = new SymfonyFilesystem();
    $options = [
        'override' => TRUE,
        'delete' => FALSE,
    ];
    $fs->mirror($this->getDrupalRoot(), $working_path, $iterator, $options);
}

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