function ComponentsIsolatedBuildTest::testComponentComposerJson
Test whether components' composer.json can be installed in isolation.
Attributes
#[DataProvider('provideComponentPaths')]
File
- 
              core/tests/ Drupal/ BuildTests/ Composer/ Component/ ComponentsIsolatedBuildTest.php, line 46 
Class
- ComponentsIsolatedBuildTest
- Try to install dependencies per component, using Composer.
Namespace
Drupal\BuildTests\Composer\ComponentCode
public function testComponentComposerJson(string $component_path) : void {
  // Only copy the components. Copy all of them because some of them depend on
  // each other.
  $finder = new Finder();
  $finder->files()
    ->ignoreUnreadableDirs()
    ->in($this->getDrupalRoot() . static::$componentsPath)
    ->ignoreDotFiles(FALSE)
    ->ignoreVCS(FALSE);
  $this->copyCodebase($finder->getIterator());
  $working_dir = $this->getWorkingPath() . static::$componentsPath . $component_path;
  // We add path repositories so we can wire internal dependencies together.
  $this->addExpectedRepositories($working_dir);
  // Perform the installation.
  $this->executeCommand("composer install --working-dir={$working_dir} --no-interaction --no-progress");
  $this->assertCommandSuccessful();
}Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.
