@@ -35,9 +35,7 @@ public function testResolvePackages(array $packages, array $expectedRequests, ar
35
35
$ body = \is_array ($ expectedRequest ['response ' ]['body ' ]) ? json_encode ($ expectedRequest ['response ' ]['body ' ]) : $ expectedRequest ['response ' ]['body ' ];
36
36
}
37
37
38
- return new MockResponse ($ body , [
39
- 'url ' => $ expectedRequest ['response ' ]['url ' ] ?? '/anything ' ,
40
- ]);
38
+ return new MockResponse ($ body );
41
39
};
42
40
}
43
41
@@ -51,6 +49,8 @@ public function testResolvePackages(array $packages, array $expectedRequests, ar
51
49
$ this ->assertArrayHasKey ($ packageName , $ expectedResolvedPackages );
52
50
$ this ->assertSame ($ expectedResolvedPackages [$ packageName ]['version ' ], $ package ->version );
53
51
}
52
+
53
+ $ this ->assertSame (count ($ expectedRequests ), $ httpClient ->getRequestsCount ());
54
54
}
55
55
56
56
public static function provideResolvePackagesTests (): iterable
@@ -64,7 +64,6 @@ public static function provideResolvePackagesTests(): iterable
64
64
],
65
65
[
66
66
'url ' => '/lodash@1.2.3/+esm ' ,
67
- 'response ' => ['url ' => 'https://cdn.jsdelivr.net/npm/lodash.js@1.2.3/+esm ' ],
68
67
],
69
68
[
70
69
'url ' => '/v1/packages/npm/lodash@1.2.3/entrypoints ' ,
@@ -87,7 +86,6 @@ public static function provideResolvePackagesTests(): iterable
87
86
],
88
87
[
89
88
'url ' => '/lodash@2.1.3/+esm ' ,
90
- 'response ' => ['url ' => 'https://cdn.jsdelivr.net/npm/lodash.js@2.1.3/+esm ' ],
91
89
],
92
90
[
93
91
'url ' => '/v1/packages/npm/lodash@2.1.3/entrypoints ' ,
@@ -110,7 +108,6 @@ public static function provideResolvePackagesTests(): iterable
110
108
],
111
109
[
112
110
'url ' => '/@hotwired/stimulus@3.1.3/+esm ' ,
113
- 'response ' => ['url ' => 'https://cdn.jsdelivr.net/npm/@hotwired/stimulus.js@3.1.3/+esm ' ],
114
111
],
115
112
[
116
113
'url ' => '/v1/packages/npm/@hotwired/stimulus@3.1.3/entrypoints ' ,
@@ -133,11 +130,6 @@ public static function provideResolvePackagesTests(): iterable
133
130
],
134
131
[
135
132
'url ' => '/chart.js@3.0.1/auto/+esm ' ,
136
- 'response ' => ['url ' => 'https://cdn.jsdelivr.net/npm/chart.js@3.0.1/auto/+esm ' ],
137
- ],
138
- [
139
- 'url ' => '/v1/packages/npm/chart.js@3.0.1/entrypoints ' ,
140
- 'response ' => ['body ' => ['entrypoints ' => []]],
141
133
],
142
134
],
143
135
'expectedResolvedPackages ' => [
@@ -156,11 +148,6 @@ public static function provideResolvePackagesTests(): iterable
156
148
],
157
149
[
158
150
'url ' => '/@chart/chart.js@3.0.1/auto/+esm ' ,
159
- 'response ' => ['url ' => 'https://cdn.jsdelivr.net/npm/@chart/chart.js@3.0.1/auto/+esm ' ],
160
- ],
161
- [
162
- 'url ' => '/v1/packages/npm/@chart/chart.js@3.0.1/entrypoints ' ,
163
- 'response ' => ['body ' => ['entrypoints ' => []]],
164
151
],
165
152
],
166
153
'expectedResolvedPackages ' => [
@@ -180,7 +167,6 @@ public static function provideResolvePackagesTests(): iterable
180
167
[
181
168
// CSS is detected: +esm is left off
182
169
'url ' => '/bootstrap@3.3.0/dist/css/bootstrap.min.css ' ,
183
- 'response ' => ['url ' => 'https://cdn.jsdelivr.net/npm/bootstrap.js@3.3.0/dist/css/bootstrap.min.css ' ],
184
170
],
185
171
],
186
172
'expectedResolvedPackages ' => [
@@ -199,7 +185,6 @@ public static function provideResolvePackagesTests(): iterable
199
185
],
200
186
[
201
187
'url ' => '/bootstrap@5.2.0/+esm ' ,
202
- 'response ' => ['url ' => 'https://cdn.jsdelivr.net/npm/bootstrap.js@5.2.0/+esm ' ],
203
188
],
204
189
[
205
190
'url ' => '/v1/packages/npm/bootstrap@5.2.0/entrypoints ' ,
@@ -214,7 +199,6 @@ public static function provideResolvePackagesTests(): iterable
214
199
[
215
200
// grab the found CSS
216
201
'url ' => '/bootstrap@5.2.0/dist/css/bootstrap.min.css ' ,
217
- 'response ' => ['url ' => 'https://cdn.jsdelivr.net/npm/bootstrap.js@5.2.0/dist/css/bootstrap.min.css ' ],
218
202
],
219
203
],
220
204
'expectedResolvedPackages ' => [
@@ -236,7 +220,6 @@ public static function provideResolvePackagesTests(): iterable
236
220
],
237
221
[
238
222
'url ' => '/bootstrap@5.2.0/dist/modal.js/+esm ' ,
239
- 'response ' => ['url ' => 'https://cdn.jsdelivr.net/npm/bootstrap.js@5.2.0/dist/modal.js+esm ' ],
240
223
],
241
224
],
242
225
'expectedResolvedPackages ' => [
0 commit comments