Skip to content

Commit

Permalink
Merge pull request florianv#126 from open-source-contributions/test_e…
Browse files Browse the repository at this point in the history
…nhancement

Fix file permission, test improvements
  • Loading branch information
florianv authored Dec 10, 2020
2 parents 6c2347d + d232d1f commit e475379
Show file tree
Hide file tree
Showing 8 changed files with 7 additions and 7 deletions.
Empty file modified LICENSE
100755 → 100644
Empty file.
Empty file modified README.md
100755 → 100644
Empty file.
Empty file modified composer.json
100755 → 100644
Empty file.
Empty file modified phpunit.xml.dist
100755 → 100644
Empty file.
2 changes: 1 addition & 1 deletion tests/Tests/Exception/ChainExceptionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class ChainExceptionTest extends TestCase
*/
private $exception2;

public function setUp(): void
protected function setUp(): void
{
$this->exception1 = new \Exception('Something bad happened.');
$this->exception2 = new \Exception('General exception.');
Expand Down
6 changes: 3 additions & 3 deletions tests/Tests/Integration/ExchangerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class ExchangerTest extends TestCase
{
private $fixerAccessKey;

public function setUp(): void
protected function setUp(): void
{
$this->fixerAccessKey = getenv('FIXER_ACCESS_KEY');
}
Expand Down Expand Up @@ -65,8 +65,8 @@ private function cacheTest(callable $provideQuery)
$thirdEnd = microtime(true) - $thirdStart;

$this->assertEquals($firstRate, $secondRate, $thirdRate);
$this->assertTrue($secondEnd < (100 * $firstEnd));
$this->assertTrue($thirdEnd < (100 * $firstEnd));
$this->assertLessThan(100 * $firstEnd, $secondEnd);
$this->assertLessThan(100 * $firstEnd, $thirdEnd);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion tests/Tests/Service/CurrencyDataFeedTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public function it_fetches_a_rate()
$rate = $service->getExchangeRate(new ExchangeRateQuery($pair));

$this->assertSame(1.18765, $rate->getValue());
$this->assertTrue('2017-12-21' == $rate->getDate()->format('Y-m-d'));
$this->assertEquals('2017-12-21', $rate->getDate()->format('Y-m-d'));
$this->assertEquals('currency_data_feed', $rate->getProviderName());
$this->assertSame($pair, $rate->getCurrencyPair());
}
Expand Down
4 changes: 2 additions & 2 deletions tests/Tests/Service/ForgeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public function it_fetches_a_rate()
$rate = $service->getExchangeRate(new ExchangeRateQuery($pair));

$this->assertSame(1.18711, $rate->getValue());
$this->assertTrue('2017-12-21' == $rate->getDate()->format('Y-m-d'));
$this->assertEquals('2017-12-21', $rate->getDate()->format('Y-m-d'));
$this->assertEquals('forge', $rate->getProviderName());
$this->assertSame($pair, $rate->getCurrencyPair());
}
Expand All @@ -75,7 +75,7 @@ public function it_fetches_a_rate_when_response_symbol_matches()

$rate = $service->getExchangeRate(new ExchangeRateQuery($pair));
$this->assertSame(9.12721, $rate->getValue());
$this->assertTrue('2018-05-30' == $rate->getDate()->format('Y-m-d'));
$this->assertEquals('2018-05-30', $rate->getDate()->format('Y-m-d'));
$this->assertEquals('forge', $rate->getProviderName());
$this->assertSame($pair, $rate->getCurrencyPair());
}
Expand Down

0 comments on commit e475379

Please sign in to comment.