Beispiel #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());
 }
Beispiel #2
0
 /**
  * @test
  */
 public function testCanToggleSymbolPosition()
 {
     $this->currency->load('USD');
     $this->assertTrue($this->currency->isSymbolFirst());
     $this->assertEquals('$ 100.00', $this->currency->format(100, true));
     $this->assertFalse($this->currency->setSymbolLast()->isSymbolFirst());
     $this->assertEquals('100.00 $', $this->currency->format(100, true));
 }
 protected function loadCurrencies()
 {
     $currencies = array_get(get_currencies(), 'iso');
     foreach ($currencies as $iso => $currency) {
         $iso = $this->prepareIso($iso);
         $currency = Currency::loadFromArray($iso, $currency);
         $this->put($iso, $currency);
     }
 }
Beispiel #4
0
 /**
  * @return bool
  */
 public function isSameCurrencies()
 {
     return $this->from->getIso() === $this->to->getIso();
 }