-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Allow providers which are selected to be installed in place of existing packages which do not satisfy requirements #8561
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
tests/Composer/Test/Fixtures/installer/provider-packages-can-be-installed-if-selected.test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
--TEST-- | ||
Test that providers can be installed if they are selected and the package they provide is not installable | ||
--COMPOSER-- | ||
{ | ||
"repositories": [ | ||
{ | ||
"type": "package", | ||
"package": [ | ||
{ | ||
"name": "foo/polyfill", | ||
"provide": { | ||
"foo/standard": "1.0.0" | ||
}, | ||
"version": "1.0.0" | ||
}, | ||
{ | ||
"name": "foo/standard", | ||
"require": { | ||
"foo/does-not-exist": "1.0.0" | ||
}, | ||
"version": "1.0.0" | ||
} | ||
] | ||
} | ||
], | ||
"require": { | ||
"foo/standard": "1.0.0", | ||
"foo/polyfill": "1.0.0" | ||
} | ||
} | ||
|
||
--RUN-- | ||
update | ||
|
||
--EXPECT-- | ||
Installing foo/polyfill (1.0.0) |
34 changes: 34 additions & 0 deletions
34
...taller/provider-packages-can-be-installed-together-with-provided-if-both-installable.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
--TEST-- | ||
Test that providers can be installed in conjunction with the package they provide if they are selected and the package they provide is also installable | ||
--COMPOSER-- | ||
{ | ||
"repositories": [ | ||
{ | ||
"type": "package", | ||
"package": [ | ||
{ | ||
"name": "foo/polyfill", | ||
"provide": { | ||
"foo/standard": "1.0.0" | ||
}, | ||
"version": "1.0.0" | ||
}, | ||
{ | ||
"name": "foo/standard", | ||
"version": "1.0.0" | ||
} | ||
] | ||
} | ||
], | ||
"require": { | ||
"foo/standard": "1.0.0", | ||
"foo/polyfill": "1.0.0" | ||
} | ||
} | ||
|
||
--RUN-- | ||
update | ||
|
||
--EXPECT-- | ||
Installing foo/standard (1.0.0) | ||
Installing foo/polyfill (1.0.0) |
55 changes: 55 additions & 0 deletions
55
...poser/Test/Fixtures/installer/provider-packages-can-not-be-installed-unless-selected.test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
--TEST-- | ||
Test that providers can not be installed if they are not selected | ||
--COMPOSER-- | ||
{ | ||
"repositories": [ | ||
{ | ||
"type": "package", | ||
"package": [ | ||
{ | ||
"name": "foo/polyfill", | ||
"provide": { | ||
"foo/standard": "1.0.0" | ||
}, | ||
"version": "1.0.0" | ||
}, | ||
{ | ||
"name": "foo/standard", | ||
"require": { | ||
"foo/does-not-exist": "1.0.0" | ||
}, | ||
"version": "1.0.0" | ||
} | ||
] | ||
} | ||
], | ||
"require": { | ||
"foo/standard": "1.0.0" | ||
} | ||
} | ||
|
||
--RUN-- | ||
update | ||
|
||
--EXPECT-EXIT-CODE-- | ||
2 | ||
|
||
--EXPECT-OUTPUT-- | ||
Loading compose 5F7C r repositories with package information | ||
Updating dependencies | ||
Your requirements could not be resolved to an installable set of packages. | ||
|
||
Problem 1 | ||
- Root composer.json requires foo/standard 1.0.0 -> satisfiable by foo/standard[1.0.0]. | ||
- foo/standard 1.0.0 requires foo/does-not-exist 1.0.0 -> no matching package found. | ||
|
||
Potential causes: | ||
- A typo in the package name | ||
- The package is not available in a stable-enough version according to your minimum-stability setting | ||
see <https://getcomposer.org/doc/04-schema.md#minimum-stability> for more details. | ||
- It's a private package and you forgot to add a custom repository to find it | ||
|
||
Read <https://getcomposer.org/doc/articles/troubleshooting.md> for further common problems. | ||
|
||
--EXPECT-- | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.