function ScaffoldUpgradeTest::createTmpRepo
Copy the provided source directory and create a temporary git repository.
Parameters
string $source: Path to directory to copy.
string $destParent: Path to location to create git repository.
string $version: Version to tag the repository with.
Return value
string Path to temporary git repository.
1 call to ScaffoldUpgradeTest::createTmpRepo()
- ScaffoldUpgradeTest::testScaffoldUpgrade in core/
tests/ Drupal/ Tests/ Composer/ Plugin/ Scaffold/ Functional/ ScaffoldUpgradeTest.php  - Tests upgrading the Composer Scaffold plugin.
 
File
- 
              core/
tests/ Drupal/ Tests/ Composer/ Plugin/ Scaffold/ Functional/ ScaffoldUpgradeTest.php, line 115  
Class
- ScaffoldUpgradeTest
 - Tests Upgrading the Composer Scaffold plugin.
 
Namespace
Drupal\Tests\Composer\Plugin\Scaffold\FunctionalCode
protected function createTmpRepo($source, $destParent, $version) {
  $target = $destParent . '/' . basename($source);
  $filesystem = new Filesystem();
  $filesystem->copy($source, $target);
  $this->mustExec("git init", $target);
  $this->mustExec('git config user.email "scaffoldtest@example.com"', $target);
  $this->mustExec('git config user.name "Scaffold Test"', $target);
  $this->mustExec("git add .", $target);
  $this->mustExec("git commit -m 'Initial commit'", $target);
  $this->mustExec("git tag {$version}", $target);
  return $target;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.