$client =
new ApiClient(new MockHttpClient([]), true, '6.4.0.0', __DIR__
);
$version =
$client->
checkForUpdates();
unset($_SERVER['SW_RECOVERY_NEXT_VERSION'
]);
static::
assertSame('6.4.1.0',
$version->version
);
} public function testCheckUsingClient(): void
{ $responses =
[ new MockResponse('["6.5.0.0-rc1", "6.4.18.0", "6.4.17.0"]',
['Content-Type' => 'application/json'
]),
new MockResponse('{"title": "Shopware", "body": "bla", "date": "2021-09-01", "version": "6.4.8.1", "fixedVulnerabilities": []}',
['Content-Type' => 'application/json'
]),
];
$client =
new ApiClient(new MockHttpClient($responses), true, '6.4.0.0', __DIR__
);
$version =
$client->
checkForUpdates();
static::
assertSame('6.4.8.1',
$version->version
);
} public function testUnknownVersion(): void
{