Ejemplo n.º 1
0
 public function testToString()
 {
     $eur = new Currency(CurrencyCode::EUR());
     $this->assertSame('EUR', $eur->__toString());
 }
Ejemplo n.º 2
0
 /**
  * Returns a Money object
  *
  * @param Integer  $amount   Amount expressed in the smallest units of $currency (e.g. cents)
  * @param Currency $currency Currency of the money object
  */
 public function __construct(Integer $amount, Currency $currency)
 {
     $baseCurrency = new BaseCurrency($currency->getCode()->toNative());
     $this->money = new BaseMoney($amount->toNative(), $baseCurrency);
     $this->currency = $currency;
 }