/** * @test */ public function itShouldReturnAValidCurrencyWithAValidCurrencyCode() { $currencyCode = Currency::CURRENCY_CODE_EURO; $currency = new Currency($currencyCode); $this->assertSame($currencyCode, $currency->code()); }
/** * @param Currency $currency * * @return float */ private function getRatioFromCurrency(Currency $currency) { $this->calculateRatesBasedOnUSDollars(); return (double) $this->ratesData[$currency->code()]; }