Пример #1
0
 /**
  * @test
  */
 public function testCanSetAndGetCurrenciesTwo()
 {
     $from = Currency::make('USD');
     $this->assertEquals($from->getIso(), $this->rate->setFrom($from)->getFromIso());
     $to = Currency::make('EUR');
     $this->assertEquals($to->getIso(), $this->rate->setTo($to)->getToIso());
 }
Пример #2
0
 /**
  * @test
  */
 public function testCanLoadCurrencyFromIso()
 {
     $this->currency->load('USD');
     $this->assertEquals('USD', $this->currency->getIso());
     $this->assertEquals('United States Dollar', $this->currency->getName());
     $this->currency->load('EUR');
     $this->assertEquals('EUR', $this->currency->getIso());
     $this->assertEquals('Euro', $this->currency->getName());
     // Static Function
     $this->currency = Currency::make('CAD');
     $this->assertEquals('CAD', $this->currency->getIso());
     $this->assertEquals('Canadian Dollar', $this->currency->getName());
 }
Пример #3
0
 /**
  * @param string $iso
  *
  * @return Currency
  */
 private function makeCurrency($iso)
 {
     return Currency::make($iso);
 }