Skip to content

Commit

Permalink
updated to php > 7.1
Browse files Browse the repository at this point in the history
  • Loading branch information
steffenbrand committed May 30, 2018
1 parent a2a1e18 commit f4d602e
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 17 deletions.
12 changes: 6 additions & 6 deletions test/CurrCurrIntegrationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
*/
class CurrCurrIntegrationTest extends TestCase
{
public function testIsInstantiable()
public function testIsInstantiable(): void
{
$this->assertInstanceOf(CurrCurr::class, $this->getInstance());
}

public function testGetExchangeRates()
public function testGetExchangeRates(): void
{
$cc = $this->getInstance();
$exchangeRates = $cc->getExchangeRates();
Expand All @@ -31,7 +31,7 @@ public function testGetExchangeRates()
$this->assertInstanceOf(\DateTime::class, $exchangeRates[Currency::USD]->getDate(), 'date must be instance of DateTime');
}

public function testGetExchangeRateByCurrency()
public function testGetExchangeRateByCurrency(): void
{
$cc = $this->getInstance();
$exchangeRate = $cc->getExchangeRateByCurrency(Currency::USD);
Expand All @@ -47,7 +47,7 @@ public function testGetExchangeRateByCurrency()
* @expectedException \SteffenBrand\CurrCurr\Exception\CurrencyNotSupportedException
* @expectedExceptionMessage The currency you are requesting the exchange rates for is not supported.
*/
public function testGetExchangeRateByCurrencyThrowsCurrencyNotSupportedException()
public function testGetExchangeRateByCurrencyThrowsCurrencyNotSupportedException(): void
{
$cc = $this->getInstance();
$cc->getExchangeRateByCurrency('SOMESTRING');
Expand All @@ -57,7 +57,7 @@ public function testGetExchangeRateByCurrencyThrowsCurrencyNotSupportedException
* @expectedException \SteffenBrand\CurrCurr\Exception\ExchangeRatesRequestFailedException
* @expectedExceptionMessage Request for ECBs exchange rates failed.
*/
public function testGetExchangeRatesThrowsExchangeRatesRequestFailedException()
public function testGetExchangeRatesThrowsExchangeRatesRequestFailedException(): void
{
$cc = $this->getInstance('http://httpstat.us/404');
$cc->getExchangeRates();
Expand All @@ -67,7 +67,7 @@ public function testGetExchangeRatesThrowsExchangeRatesRequestFailedException()
* @expectedException \SteffenBrand\CurrCurr\Exception\ExchangeRatesMappingFailedException
* @expectedExceptionMessage Could not successfully parse and map exchange rates.
*/
public function testGetExchangeRatesThrowsExchangeRatesMappingFailedException()
public function testGetExchangeRatesThrowsExchangeRatesMappingFailedException(): void
{
$cc = $this->getInstance('http://httpstat.us/200');
$cc->getExchangeRates();
Expand Down
12 changes: 6 additions & 6 deletions test/CurrCurrMockTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
*/
class CurrCurrMockTest extends TestCase
{
public function testIsInstantiable()
public function testIsInstantiable(): void
{
$this->assertInstanceOf(CurrCurr::class, $this->getInstance(EcbClientMock::VALID_RESPONSE));
}

public function testGetExchangeRates()
public function testGetExchangeRates(): void
{
$cc = $this->getInstance(EcbClientMock::VALID_RESPONSE);
$exchangeRates = $cc->getExchangeRates();
Expand All @@ -34,7 +34,7 @@ public function testGetExchangeRates()
$this->assertEquals(1.0994, $exchangeRates[Currency::USD]->getRate(), 'Rate must be 1.0994');
}

public function testGetExchangeRateByCurrency()
public function testGetExchangeRateByCurrency(): void
{
$cc = $this->getInstance(EcbClientMock::VALID_RESPONSE);
$exchangeRate = $cc->getExchangeRateByCurrency(Currency::USD);
Expand All @@ -53,7 +53,7 @@ public function testGetExchangeRateByCurrency()
* @expectedException \SteffenBrand\CurrCurr\Exception\CurrencyNotSupportedException
* @expectedExceptionMessage The currency you are requesting the exchange rates for is not supported.
*/
public function testSomeStringThrowsCurrencyNotSupportedException()
public function testSomeStringThrowsCurrencyNotSupportedException(): void
{
$cc = $this->getInstance(EcbClientMock::VALID_RESPONSE);
$cc->getExchangeRateByCurrency('SOMESTRING');
Expand All @@ -63,7 +63,7 @@ public function testSomeStringThrowsCurrencyNotSupportedException()
* @expectedException \SteffenBrand\CurrCurr\Exception\CurrencyNotSupportedException
* @expectedExceptionMessage The currency you are requesting the exchange rates for is not supported.
*/
public function testMissingUsdThrowsCurrencyNotSupportedException()
public function testMissingUsdThrowsCurrencyNotSupportedException(): void
{
$cc = $this->getInstance(EcbClientMock::USD_MISSING_RESPONSE);
$cc->getExchangeRateByCurrency(Currency::USD);
Expand All @@ -73,7 +73,7 @@ public function testMissingUsdThrowsCurrencyNotSupportedException()
* @expectedException \SteffenBrand\CurrCurr\Exception\ExchangeRatesMappingFailedException
* @expectedExceptionMessage Could not successfully parse and map exchange rates.
*/
public function testMissingDateThrowsExchangeRatesMappingFailedException()
public function testMissingDateThrowsExchangeRatesMappingFailedException(): void
{
$cc = $this->getInstance(EcbClientMock::DATE_MISSING_RESPONSE);
$cc->getExchangeRates();
Expand Down
9 changes: 4 additions & 5 deletions test/CurrCurrSimpleCacheIntegrationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@
*/
class CurrCurrSimpleCacheIntegrationTest extends TestCase
{
public function testIsInstantiable()
public function testIsInstantiable(): void
{
$this->assertInstanceOf(CurrCurr::class, $this->getInstance(uniqid()));
$this->assertInstanceOf(CurrCurr::class, $this->getInstance(uniqid('test', false)));
}

public function testGetExchangeRatesMidnightCache()
public function testGetExchangeRatesMidnightCache(): void
{
$cc = $this->getInstance(uniqid('test', false));
$this->getRates($cc);
Expand Down Expand Up @@ -49,9 +49,8 @@ private function getInstance(string $cacheKey): CurrCurr
/**
* @param CurrCurr $cc
*/
private function getRates(CurrCurr $cc)
private function getRates(CurrCurr $cc): void
{

$exchangeRates = $cc->getExchangeRates();

$this->assertNotNull($exchangeRates, 'exchange rates must not be null');
Expand Down

0 comments on commit f4d602e

Please sign in to comment.