Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
automatic_updates
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
automatic_updates
Merge requests
!27
Issue
#3230507
: Create build tests for case where site is using core recommended Composer project
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Issue
#3230507
: Create build tests for case where site is using core recommended Composer project
issue/automatic_updates-3230507:3230507-create-build-tests
into
8.x-2.x
Overview
2
Commits
26
Pipelines
0
Changes
3
1 unresolved thread
Hide all comments
Merged
Adam G-H
requested to merge
issue/automatic_updates-3230507:3230507-create-build-tests
into
8.x-2.x
3 years ago
Overview
2
Commits
26
Pipelines
0
Changes
3
1 unresolved thread
Hide all comments
Expand
0
0
Merge request reports
Viewing commit
acc38722
Prev
Next
Show latest version
3 files
+
157
−
21
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
3
Search (e.g. *.vue) (Ctrl+P)
acc38722
Add passing, skipped test
· acc38722
Adam G-H
authored
3 years ago
tests/src/Build/AttendedCoreRecommendedUpdateTest.php
0 → 100644
+
76
−
0
Options
<?php
namespace
Drupal\Tests\automatic_updates\Build
;
/**
* Tests an end-to-end core update via the core-recommended metapackage.
*
* @group automatic_updates
*/
class
AttendedCoreRecommendedUpdateTest
extends
AttendedCoreUpdateTest
{
/**
* {@inheritdoc}
*/
protected
$docRoot
=
'docroot/'
;
/**
* {@inheritdoc}
*/
protected
function
prepareForUpdate
(
string
$version
):
void
{
parent
::
prepareForUpdate
(
$version
);
$composer
=
$this
->
getWorkspaceDirectory
()
.
"/composer.json"
;
$data
=
$this
->
readJson
(
$composer
);
$data
[
'repositories'
][
'drupal/core-recommended'
]
=
[
'type'
=>
'path'
,
'url'
=>
$this
->
createTargetMetapackage
(
$version
),
'options'
=>
[
'symlink'
=>
FALSE
,
],
];
$this
->
writeJson
(
$composer
,
$data
);
}
/**
* {@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'
);
$composer
=
$destination
.
'/composer.json'
;
$data
=
$this
->
readJson
(
$composer
);
$data
[
'version'
]
=
$version
;
$data
[
'require'
][
'drupal/core'
]
=
$version
;
$this
->
writeJson
(
$composer
,
$data
);
return
$destination
;
}
/**
* {@inheritdoc}
*/
protected
function
getComposerConfiguration
():
array
{
$configuration
=
parent
::
getComposerConfiguration
();
$require
=
&
$configuration
[
'require'
];
$require
[
'drupal/core-recommended'
]
=
$require
[
'drupal/core'
];
unset
(
$require
[
'drupal/core'
]);
return
$configuration
;
}
}
Loading