Narcissus 4年前

修改理由:

接口 url 错误

相关信息:


此投稿状态为 标记为已读

内容修改:

红色背景 为原始内容

绿色背景 为新增或者修改的内容

OldNewDifferences
8080   .
8181   public function getWeather($city, $type = 'base', $format = 'json')
8282   {
83        $url = 'https://restapi.amap.com/v3/weather/weatherInfo';
 83       $url = 'https://restapi.amap.com/v3/weather/weatherInfo?parameters';
8484
8585       // 1. 对 `$format` 与 `$type` 参数进行检查,不在范围内的抛出异常。
8686       if (!\in_array($format, ['xml', 'json'])) {
 
236236       $client = \Mockery::mock(Client::class);
237237
238238       // 指定将会产生的行为(在后续的测试中将会按下面的参数来调用)。
239        $client->allows()->get('https://restapi.amap.com/v3/weather/weatherInfo', [
 239       $client->allows()->get('https://restapi.amap.com/v3/weather/weatherInfo?parameters', [
240240           'query' => [
241241               'key' => 'mock-key',
242242               'city' => '深圳',
 
283283       // json
284284       $response = new Response(200, [], '{"success": true}');
285285       $client = \Mockery::mock(Client::class);
286        $client->allows()->get('https://restapi.amap.com/v3/weather/weatherInfo', [
 286       $client->allows()->get('https://restapi.amap.com/v3/weather/weatherInfo?parameters', [
287287           'query' => [
288288               'key' => 'mock-key',
289289               'city' => '深圳',
 
300300       // xml
301301       $response = new Response(200, [], '<hello>content</hello>');
302302       $client = \Mockery::mock(Client::class);
303        $client->allows()->get('https://restapi.amap.com/v3/weather/weatherInfo', [
 303       $client->allows()->get('https://restapi.amap.com/v3/weather/weatherInfo?parameters', [
304304           'query' => [
305305               'key' => 'mock-key',
306306               'city' => '深圳',
 
463463       // json
464464       $response = new Response(200, [], '{"success": true}');
465465       $client = \Mockery::mock(Client::class);
466        $client->allows()->get('https://restapi.amap.com/v3/weather/weatherInfo', [
 466       $client->allows()->get('https://restapi.amap.com/v3/weather/weatherInfo?parameters, [
467467           'query' => [
468468               'key' => 'mock-key',
469469               'city' => '深圳',
 
480480       // xml
481481       $response = new Response(200, [], '<hello>content</hello>');
482482       $client = \Mockery::mock(Client::class);
483        $client->allows()->get('https://restapi.amap.com/v3/weather/weatherInfo', [
 483       $client->allows()->get('https://restapi.amap.com/v3/weather/weatherInfo?parameters', [
484484           'query' => [
485485               'key' => 'mock-key',
486486               'city' => '深圳',