Skip to content

Commit

Permalink
Fix ExchangeRatesApiTest.php method names to snake_case
Browse files Browse the repository at this point in the history
  • Loading branch information
Seagull-4auKa committed Apr 25, 2021
1 parent b8dfa75 commit b98715e
Showing 1 changed file with 27 additions and 8 deletions.
35 changes: 27 additions & 8 deletions tests/Tests/Service/ExchangeRatesApiTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@
*/
class ExchangeRatesApiTest extends ServiceTestCase
{
public function testItDoesNotSupportAllQueries()
/**
* @test
*/
public function it_does_support_all_queries()
{
$service = new ExchangeRatesApi(
$this->createMock('Http\Client\HttpClient'),
Expand All @@ -35,13 +38,19 @@ public function testItDoesNotSupportAllQueries()
$this->assertFalse($service->supportQuery(new ExchangeRateQuery(CurrencyPair::createFromString('USD/EUR'))));
}

public function testItSupportsEurBase()
/**
* @test
*/
public function it_supports_eur_base()
{
$service = new ExchangeRatesApi($this->createMock('Http\Client\HttpClient'), null, ['access_key' => 'x']);
$this->assertTrue($service->supportQuery(new ExchangeRateQuery(CurrencyPair::createFromString('EUR/CAD'))));
}

public function testItDoesSupportAllQueriesEnterpriseMode()
/**
* @test
*/
public function it_does_support_other_than_eur()
{
$service = new ExchangeRatesApi(
$this->createMock('Http\Client\HttpClient'),
Expand All @@ -52,9 +61,10 @@ public function testItDoesSupportAllQueriesEnterpriseMode()
}

/**
* @test
* @dataProvider unsupportedCurrencyPairResponsesProvider
*/
public function testItThrowsAnUnsupportedCurrencyPairException(
public function it_throws_An_unsupported_currency_pair_exception(
string $contentPath,
string $uri,
string $accessKey,
Expand Down Expand Up @@ -115,7 +125,7 @@ public function unsupportedCurrencyPairResponsesProvider(): array
/**
* @dataProvider errorResponsesProvider
*/
public function testItThrowsAnExceptionWithErrorResponse(
public function it_throws_an_exception_with_error_response(
string $contentPath,
string $uri,
string $accessKey,
Expand Down Expand Up @@ -186,7 +196,10 @@ public function errorResponsesProvider(): array
];
}

public function testItFetchesARate()
/**
* @test
*/
public function it_fetches_a_rate()
{
$pair = CurrencyPair::createFromString('EUR/USD');
$uri = 'https://api.exchangeratesapi.io/latest?base=EUR&access_key=x&symbols=USD';
Expand All @@ -205,7 +218,10 @@ public function testItFetchesARate()
$this->assertSame($pair, $rate->getCurrencyPair());
}

public function testItFetchesAHistoricalRate()
/**
* @test
*/
public function it_fetches_a_historical_rate()
{
$pair = CurrencyPair::createFromString('EUR/USD');
$uri = 'https://api.exchangeratesapi.io/2021-04-15?base=EUR&access_key=x&symbols=USD';
Expand All @@ -225,7 +241,10 @@ public function testItFetchesAHistoricalRate()
$this->assertSame($pair, $rate->getCurrencyPair());
}

public function testItHasAName()
/**
* @test
*/
public function it_has_a_name()
{
$service = new ExchangeRatesApi($this->createMock('Http\Client\HttpClient'), null, ['access_key' => 'x']);

Expand Down

0 comments on commit b98715e

Please sign in to comment.