@@ -27,15 +27,19 @@ public function testMissingRequires(array $expected, InstalledArrayRepository $r
27
27
public static function provideMissingRequires ()
28
28
{
29
29
$ 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
+ ]);
31
33
32
34
yield 'empty ' => [[[], [], []], $ repo , [], []];
33
35
34
36
$ rootRequires = [
35
37
'php-http/discovery ' => $ link ,
36
38
'php-http/async-client-implementation ' => $ link ,
39
+ 'psr/http-message-implementation ' => $ link ,
37
40
];
38
41
$ expected = [[
42
+ 'psr/http-message-implementation ' => [],
39
43
'php-http/async-client-implementation ' => [
40
44
'symfony/http-client ' ,
41
45
'guzzlehttp/promises ' ,
@@ -49,15 +53,30 @@ public static function provideMissingRequires()
49
53
yield 'async-httplug ' => [$ expected , $ repo , $ rootRequires , []];
50
54
51
55
$ repo = new InstalledArrayRepository ([
56
+ 'php-http/discovery ' => new Package ('php-http/discovery ' , '1.0.0.0 ' , '1.0 ' ),
52
57
'nyholm/psr7 ' => new Package ('nyholm/psr7 ' , '1.0.0.0 ' , '1.0 ' ),
53
58
]);
54
59
$ repo ->setDevPackageNames (['nyholm/psr7 ' ]);
55
60
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
+ ],
57
72
'psr/http-factory-implementation ' => [
58
73
'nyholm/psr7 ' ,
59
74
],
60
- ];
75
+ ], [], [
76
+ 'psr/http-factory-implementation ' => [
77
+ 'nyholm/psr7 ' ,
78
+ ],
79
+ ]];
61
80
62
81
yield 'move-to-require ' => [$ expected , $ repo , $ rootRequires , []];
63
82
}
0 commit comments