Skip to content

Commit e2a2e65

Browse files
Fix resolving deps for psr/http-message-implementation (#214)
1 parent dc74166 commit e2a2e65

File tree

2 files changed

+23
-4
lines changed

2 files changed

+23
-4
lines changed

src/Composer/Plugin.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ class Plugin implements PluginInterface, EventSubscriberInterface
6666
'kriswallsmith/buzz:^1' => [],
6767
],
6868
'psr/http-message-implementation' => [
69-
'psr/http-factory-implementation' => [],
69+
'php-http/discovery' => ['psr/http-factory-implementation'],
7070
],
7171
'psr/http-factory-implementation' => [
7272
'nyholm/psr7' => [],

tests/Composer/PluginTest.php

+22-3
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,19 @@ public function testMissingRequires(array $expected, InstalledArrayRepository $r
2727
public static function provideMissingRequires()
2828
{
2929
$link = new Link('source', 'target', new Constraint(Constraint::STR_OP_GE, '1'));
30-
$repo = new InstalledArrayRepository([]);
30+
$repo = new InstalledArrayRepository([
31+
'php-http/discovery' => new Package('php-http/discovery', '1.0.0.0', '1.0'),
32+
]);
3133

3234
yield 'empty' => [[[], [], []], $repo, [], []];
3335

3436
$rootRequires = [
3537
'php-http/discovery' => $link,
3638
'php-http/async-client-implementation' => $link,
39+
'psr/http-message-implementation' => $link,
3740
];
3841
$expected = [[
42+
'psr/http-message-implementation' => [],
3943
'php-http/async-client-implementation' => [
4044
'symfony/http-client',
4145
'guzzlehttp/promises',
@@ -49,15 +53,30 @@ public static function provideMissingRequires()
4953
yield 'async-httplug' => [$expected, $repo, $rootRequires, []];
5054

5155
$repo = new InstalledArrayRepository([
56+
'php-http/discovery' => new Package('php-http/discovery', '1.0.0.0', '1.0'),
5257
'nyholm/psr7' => new Package('nyholm/psr7', '1.0.0.0', '1.0'),
5358
]);
5459
$repo->setDevPackageNames(['nyholm/psr7']);
5560

56-
$expected[2] = [
61+
$rootRequires = [
62+
'php-http/discovery' => $link,
63+
'php-http/async-client-implementation' => $link,
64+
];
65+
66+
$expected = [[
67+
'php-http/async-client-implementation' => [
68+
'symfony/http-client',
69+
'guzzlehttp/promises',
70+
'php-http/message-factory',
71+
],
5772
'psr/http-factory-implementation' => [
5873
'nyholm/psr7',
5974
],
60-
];
75+
], [], [
76+
'psr/http-factory-implementation' => [
77+
'nyholm/psr7',
78+
],
79+
]];
6180

6281
yield 'move-to-require' => [$expected, $repo, $rootRequires, []];
6382
}

0 commit comments

Comments
 (0)