/**
* Tests upgrading the Composer Scaffold plugin.
*/
public function testScaffoldUpgrade() { $composerVersionLine =
exec('composer --version'
);
if (str_contains($composerVersionLine, 'Composer version 2'
)) { $this->
markTestSkipped('We cannot run the scaffold upgrade test with Composer 2 until we have a stable version of drupal/core-composer-scaffold to start from that we can install with Composer 2.x.'
);
} $this->fixturesDir =
$this->fixtures->
tmpDir($this->
getName());
$replacements =
['SYMLINK' => 'false', 'PROJECT_ROOT' =>
$this->fixtures->
projectRoot()];
$this->fixtures->
cloneFixtureProjects($this->fixturesDir,
$replacements);
$topLevelProjectDir = 'drupal-drupal';
$sut =
$this->fixturesDir . '/' .
$topLevelProjectDir;
// First step: set up the Scaffold plug in. Ensure that scaffold operation
// ran. This is more of a control than a test.
$this->
mustExec("composer install --no-ansi",
$sut);
$this->
assertScaffoldedFile($sut . '/sites/default/default.settings.php', FALSE, 'A settings.php fixture file scaffolded from the scaffold-override-fixture'
);
// Next, bring back packagist.org and install core-composer-scaffold:8.8.0.
// Packagist is disabled in the fixture; we bring it back by removing the
// line that disables it.