runComposer example


  public function scaffoldSut($fixture_name$is_link = FALSE, $relocated_docroot = TRUE) {
    $sut = $this->createSut($fixture_name['SYMLINK' => $is_link ? 'true' : 'false']);
    // Run composer install to get the dependencies we need to test.     $this->fixtures->runComposer("install --no-ansi --no-scripts --no-plugins", $sut);
    // Test drupal:scaffold.     $scaffoldOutput = $this->fixtures->runScaffold($sut);

    // Calculate the docroot directory and assert that our fixture layout     // matches what was stipulated in $relocated_docroot. Fail fast if     // the caller provided the wrong value.     $docroot = $sut;
    if ($relocated_docroot) {
      $docroot .= '/docroot';
      $this->assertFileExists($docroot);
    }
    
$sut = $this->fixturesDir . '/' . $fixture_name;
    $replacements = ['SYMLINK' => 'false', 'PROJECT_ROOT' => $this->projectRoot];
    $this->fixtures->cloneFixtureProjects($this->fixturesDir, $replacements);
    // .gitignore files will not be managed unless there is a git repository.     $this->mustExec('git init', $sut);
    // Add some user info so git does not complain.     $this->mustExec('git config user.email "test@example.com"', $sut);
    $this->mustExec('git config user.name "Test User"', $sut);
    $this->mustExec('git add .', $sut);
    $this->mustExec('git commit -m "Initial commit."', $sut);
    // Run composer install, but suppress scaffolding.     $this->fixtures->runComposer("install --no-ansi --no-scripts --no-plugins", $sut);
    return $sut;
  }

  /** * Tests scaffold command correctly manages the .gitignore file. */
  public function testManageGitIgnore() {
    // Note that the drupal-composer-drupal-project fixture does not     // have any configuration settings related to .gitignore management.     $sut = $this->createSutWithGit('drupal-composer-drupal-project');
    $this->assertFileDoesNotExist($sut . '/docroot/autoload.php');
    
Home | Imprint | This part of the site doesn't use cookies.