Exemplo n.º 1
0
 public function testGetCurrencyWithCode()
 {
     $code = 'EUR';
     $currency = new Currency($this->repository, $code);
     $localized_currency = $currency->localize($this->locale);
     $this->assertEquals($localized_currency->name, 'euro');
 }
Exemplo n.º 2
0
 /**
  * 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);
 }