File tree Expand file tree Collapse file tree 4 files changed +8
-7
lines changed
tests/Infrastructure/Http Expand file tree Collapse file tree 4 files changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -81,11 +81,11 @@ Pre-requisites (see [composer.json](composer.json)) :
81
81
- ext-pgsql
82
82
- [ Symfony local web server] ( https://symfony.com/doc/current/setup/symfony_server.html )
83
83
84
- Create an account on [ OpenWeatherMap ] ( https://home.openweathermap.org/api_keys ) and copy your api key :
84
+ Create an App on [ AccuWeather ] ( https://developer.accuweather.com/ ) and copy your API Key :
85
85
86
86
```
87
87
# in /.env.dev.local
88
- OPENWEATHER_API_KEY =xxx
88
+ ACCUWEATHER_API_KEY =xxx
89
89
```
90
90
91
91
Start local dev environment with:
Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ services:
38
38
arguments :
39
39
- base_uri : ' %env(ACCUWEATHER_BASE_URI)%'
40
40
41
- App\Infrastructure\Http\RestWeatherProvider :
41
+ App\Infrastructure\Http\HttpAccuWeatherProvider :
42
42
arguments :
43
43
$client : ' @guzzle.accuweather'
44
44
$apiKey : ' %env(ACCUWEATHER_API_KEY)%'
Original file line number Diff line number Diff line change 9
9
use GuzzleHttp \Client ;
10
10
use GuzzleHttp \Exception \GuzzleException ;
11
11
12
- class RestWeatherProvider implements WeatherProvider
12
+ class HttpAccuWeatherProvider implements WeatherProvider
13
13
{
14
+ // See https://developer.accuweather.com/accuweather-current-conditions-api/apis
14
15
public const CURRENT_CONDITION_URI = 'currentconditions/v1/%d?apikey=%s ' ;
15
16
public const LOCATION_KEY_PARIS = 623 ;
16
17
Original file line number Diff line number Diff line change 12
12
/**
13
13
* @group integration
14
14
*/
15
- class RestWeatherProviderTest extends TestCase
15
+ class HttpAccuWeatherProviderTest extends TestCase
16
16
{
17
- private RestWeatherProvider $ provider ;
17
+ private HttpAccuWeatherProvider $ provider ;
18
18
private WireMock $ wireMock ;
19
19
private string $ currentConditionUri ;
20
20
@@ -25,7 +25,7 @@ protected function setUp(): void
25
25
$ host = 'wiremock ' ;
26
26
$ port = '8080 ' ;
27
27
28
- $ this ->provider = new RestWeatherProvider (
28
+ $ this ->provider = new HttpAccuWeatherProvider (
29
29
// See https://docs.guzzlephp.org/en/stable/quickstart.html#creating-a-client
30
30
new Client (['base_uri ' => "http:// $ host: $ port/ " ]),
31
31
$ accuweatherApiKey ,
You can’t perform that action at this time.
0 commit comments