tests/TestCase/Controller/Component/CurrencyConverterComponentTest.php 1 location
|
@@ 195-204 (lines=10) @@
|
| 192 |
|
$this->assertEquals($expected, $result); |
| 193 |
|
} |
| 194 |
|
|
| 195 |
|
public function testRateUsingDatabaseWhenRateDoNotExistInDatabase() |
| 196 |
|
{ |
| 197 |
|
$fromCurrency = 'EUR'; |
| 198 |
|
$toCurrency = 'USD'; |
| 199 |
|
|
| 200 |
|
$result = $this->CurrencyConverter->rate($fromCurrency, $toCurrency); |
| 201 |
|
$expected = $this->Table->find('all')->where(['from_currency' => 'EUR', 'to_currency' => 'USD'])->first()->rate; |
| 202 |
|
|
| 203 |
|
$this->assertEquals($expected, $result); |
| 204 |
|
} |
| 205 |
|
|
| 206 |
|
public function testRateUsingDatabaseWhenRateExistInDatabaseAndNoNeedToBeUpdated() |
| 207 |
|
{ |
tests/TestCase/View/Helper/CurrencyConverterHelperTest.php 1 location
|
@@ 196-205 (lines=10) @@
|
| 193 |
|
$this->assertEquals($expected, $result); |
| 194 |
|
} |
| 195 |
|
|
| 196 |
|
public function testRateUsingDatabaseWhenRateDoNotExistInDatabase() |
| 197 |
|
{ |
| 198 |
|
$fromCurrency = 'EUR'; |
| 199 |
|
$toCurrency = 'USD'; |
| 200 |
|
|
| 201 |
|
$result = $this->CurrencyConverter->rate($fromCurrency, $toCurrency); |
| 202 |
|
$expected = $this->Table->find('all')->where(['from_currency' => 'EUR', 'to_currency' => 'USD'])->first()->rate; |
| 203 |
|
|
| 204 |
|
$this->assertEquals($expected, $result); |
| 205 |
|
} |
| 206 |
|
|
| 207 |
|
public function testRateUsingDatabaseWhenRateExistInDatabaseAndNoNeedToBeUpdated() |
| 208 |
|
{ |