/** * @param array $arguments * * @return string */ public static function missingVersion(array $arguments) { $service = isset($arguments['service']) ? $arguments['service'] : ''; $versions = ApiProvider::defaultProvider()->getVersions($service); $versions = implode("\n", array_map(function ($v) { return "* \"{$v}\""; }, $versions)) ?: '* (not found)'; return <<<TIPS A "version" configuration value is required. Specifying a version constraint ensures that your code will not be affected by a breaking change made to the service. For example, when using Upyun, you can lock your API version to "v1". Your build of the SDK has the following version(s) of "{$service}": {$versions} You may provide "latest" to the "version" configuration value to utilize the most recent available API version that your client's API provider can find. Note: Using 'latest' in a production application is not recommended. A list of available API versions can be found on each client's API documentation page: https://github.com/AbrahamGreyson/cloudatlas . If you are unable to load a specific API version, then you may need to update your copy of the SDK. TIPS; }
public function testCanGetDefaultProvider() { $p = ApiProvider::defaultProvider(); $this->assertArrayHasKey('upyun', $this->readAttribute($p, 'manifest')); }