$this->
assertSame($expectedRequestBody,
json_decode($options['body'
], true
));
return new MockResponse(json_encode($responseData));
};
// mock the "file download" requests
foreach ($expectedDownloadedFiles as $file) { $responses[] =
new MockResponse(sprintf('contents of %s',
$file));
} $httpClient =
new MockHttpClient($responses);
$provider =
new JspmResolver($httpClient, ImportMapManager::PROVIDER_JSPM
);
$actualResolvedPackages =
$provider->
resolvePackages($packages);
$this->
assertCount(\
count($expectedResolvedPackages),
$actualResolvedPackages);
foreach ($actualResolvedPackages as $package) { $packageName =
$package->requireOptions->packageName;
$this->
assertArrayHasKey($packageName,
$expectedResolvedPackages);
$this->
assertSame($expectedResolvedPackages[$packageName]['url'
],
$package->url
);
} } public static function provideResolvePackagesTests(): iterable
{