public function testGetCurrencyWithCode() { $code = 'EUR'; $currency = new Currency($this->repository, $code); $localized_currency = $currency->localize($this->locale); $this->assertEquals($localized_currency->name, 'euro'); }
/** * Return a formatted price * * @param float $price * @param string $code iso code * * @return string well formatted price */ public function getPrice($price, $code) { $currency = new Currency($this->repository, $code); $localized_currency = $currency->localize($this->getCulture()); return $localized_currency->format($price); }