Skip to content

Commit 3ad15f6

Browse files
committed
feat: user agent and tests
1 parent 09183c7 commit 3ad15f6

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

src/Service/HttpService.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ private function buildRequest($url, array $headers = []): RequestInterface
7676
$request = $request->withHeader($header, $value);
7777
}
7878

79+
$request = $request->withHeader('User-Agent', 'Swap');
80+
7981
return $request;
8082
}
8183

tests/Tests/Service/ApiLayer/CurrencyDataTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public function it_fetches_a_rate()
8383
public function it_fetches_a_historical_rate()
8484
{
8585
$pair = CurrencyPair::createFromString('USD/AED');
86-
$uri = 'http://apilayer.net/api/historical?apikey=secret&date=2015-05-06';
86+
$uri = 'https://api.apilayer.com/currency_data/historical?apikey=secret&date=2015-05-06';
8787
$content = file_get_contents(__DIR__.'/../../../Fixtures/Service/ApiLayer/CurrencyData/historical_success.json');
8888
$date = new \DateTime('2015-05-06');
8989
$expectedDate = new \DateTime();

tests/Tests/Service/ApiLayer/ExchangeRatesDataTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ public function errorResponsesProvider(): array
185185
public function it_fetches_a_rate()
186186
{
187187
$pair = CurrencyPair::createFromString('EUR/USD');
188-
$uri = 'https://api.apilayer.com/exchangerates_data/latest?base=EUR&api_key=x&symbols=USD';
188+
$uri = 'https://api.apilayer.com/exchangerates_data/latest?base=EUR&apikey=x&symbols=USD';
189189
$content = file_get_contents(__DIR__.'/../../../Fixtures/Service/ApiLayer/ExchangeRatesData/latest.json');
190190

191191
$service = new ExchangeRatesData(

0 commit comments

Comments
 (0)