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
Commits
5ac879de
Commit
5ac879de
authored
2 years ago
by
Ted Bowman
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3273407
by tedbow: Move 'addRepository()' to TemplateProjectTestBase class
parent
9ce9b7bf
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!250
Issue #3273407: Move 'addRepository()' to TemplateProjectTestBase class
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
package_manager/tests/src/Build/PackageUpdateTest.php
+0
-21
0 additions, 21 deletions
package_manager/tests/src/Build/PackageUpdateTest.php
package_manager/tests/src/Build/TemplateProjectTestBase.php
+24
-9
24 additions, 9 deletions
package_manager/tests/src/Build/TemplateProjectTestBase.php
with
24 additions
and
30 deletions
package_manager/tests/src/Build/PackageUpdateTest.php
+
0
−
21
View file @
5ac879de
...
...
@@ -115,25 +115,4 @@ class PackageUpdateTest extends TemplateProjectTestBase {
$this
->
assertSame
(
$expected_post_apply_results
,
$results
[
'post'
]);
}
/**
* Adds a path repository to the test site.
*
* @param string $name
* An arbitrary name for the repository.
* @param string $path
* The path of the repository. Must exist in the file system.
*/
private
function
addRepository
(
string
$name
,
string
$path
):
void
{
$this
->
assertDirectoryExists
(
$path
);
$repository
=
json_encode
([
'type'
=>
'path'
,
'url'
=>
$path
,
'options'
=>
[
'symlink'
=>
FALSE
,
],
]);
$this
->
runComposer
(
"composer config repo.
$name
'
$repository
'"
,
'project'
);
}
}
This diff is collapsed.
Click to expand it.
package_manager/tests/src/Build/TemplateProjectTestBase.php
+
24
−
9
View file @
5ac879de
...
...
@@ -113,6 +113,29 @@ END;
return
$packages
;
}
/**
* Adds a path repository to the test site.
*
* @param string $name
* An arbitrary name for the repository.
* @param string $path
* The path of the repository. Must exist in the file system.
* @param string $working_directory
* (optional) The Composer working directory. Defaults to 'project'.
*/
protected
function
addRepository
(
string
$name
,
string
$path
,
$working_directory
=
'project'
):
void
{
$this
->
assertDirectoryExists
(
$path
);
$repository
=
json_encode
([
'type'
=>
'path'
,
'url'
=>
$path
,
'options'
=>
[
'symlink'
=>
FALSE
,
],
],
JSON_UNESCAPED_SLASHES
);
$this
->
runComposer
(
"composer config repo.
$name
'
$repository
'"
,
$working_directory
);
}
/**
* Creates a test project from a given template and installs Drupal.
*
...
...
@@ -142,15 +165,7 @@ END;
// symlinking, we need to pass the JSON representations of the repositories
// to `composer config`.
foreach
(
$this
->
getCorePackages
()
as
$name
=>
$path
)
{
$repository
=
[
'type'
=>
'path'
,
'url'
=>
$path
,
'options'
=>
[
'symlink'
=>
FALSE
,
],
];
$repository
=
json_encode
(
$repository
,
JSON_UNESCAPED_SLASHES
);
$this
->
runComposer
(
"composer config repo.
$name
'
$repository
'"
,
$template_dir
);
$this
->
addRepository
(
$name
,
$path
,
$template_dir
);
}
// Add a local Composer repository with all third-party dependencies.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment