Skip to content
Snippets Groups Projects

Issue #3230507: Create build tests for case where site is using core recommended Composer project

Merged Issue #3230507: Create build tests for case where site is using core recommended Composer project
1 unresolved thread
1 unresolved thread
Compare and Show latest version
4 files
+ 124
136
Compare changes
  • Side-by-side
  • Inline
Files
4
@@ -17,60 +17,53 @@ class AttendedCoreRecommendedUpdateTest extends AttendedCoreUpdateTest {
/**
* {@inheritdoc}
*/
protected function prepareForUpdate(string $version): void {
parent::prepareForUpdate($version);
protected function getConfigurationForUpdate(string $version): array {
$changes = parent::getConfigurationForUpdate($version);
$this->alterPackage($this->getWorkspaceDirectory(), [
'repositories' => [
'drupal/core-recommended' => [
'type' => 'path',
'url' => $this->createTargetMetapackage($version),
'options' => [
'symlink' => FALSE,
],
],
// Create a fake version of drupal/core-recommended which requires the
// target version of drupal/core.
$dir = $this->copyPackage($this->getDrupalRoot() . '/composer/Metapackage/CoreRecommended');
$this->alterPackage($dir, [
'version' => $version,
'require' => [
'drupal/core' => $version,
],
]);
$changes['repositories']['drupal/core-recommended']['url'] = $dir;
return $changes;
}
/**
* {@inheritdoc}
*/
public function test(): void {
$this->markTestSkipped('This test is disabled until automatic_updates supports drupal/core-recommended.');
}
/**
* Creates a mocked version of drupal/core-recommended to update to.
*
* @param string $version
* The version of the mocked metapackage.
*
* @return string
* The path of the mocked package.
*/
protected function createTargetMetapackage(string $version): string {
$destination = $this->mockPackage($this->getDrupalRoot() . '/composer/Metapackage/CoreRecommended');
$this->alterPackage($destination, [
'version' => $version,
'require' => [
'drupal/core' => $version,
],
]);
return $destination;
// @todo Remove this method entirely when drupal/core-recommended is
// supported, since the update workflow is identical to the parent method.
$this->markTestSkipped('Disabled until Automatic Updates supports drupal/core-recommended.');
}
/**
* {@inheritdoc}
*/
protected function getComposerConfiguration(): array {
$configuration = parent::getComposerConfiguration();
protected function getInitialConfiguration(): array {
$configuration = parent::getInitialConfiguration();
// Use drupal/core-recommended to build the test site, instead of directly
// requiring drupal/core.
$require = &$configuration['require'];
$require['drupal/core-recommended'] = $require['drupal/core'];
unset($require['drupal/core']);
$configuration['repositories']['drupal/core-recommended'] = [
'type' => 'path',
'url' => implode(DIRECTORY_SEPARATOR, [
$this->getDrupalRoot(),
'composer',
'Metapackage',
'CoreRecommended',
]),
];
return $configuration;
}
Loading