Example #1
0
 /**
  * @param string $key
  * @param float  $exchangeRate
  *
  * @return RateCollection
  */
 public function add($key, $exchangeRate)
 {
     $rate = new Rate();
     $rate->setKey($key)->setExchangeRate($exchangeRate);
     if (!$this->has($key)) {
         $this->put($key, $rate);
     }
     return $this;
 }
Example #2
0
 /**
  * @test
  */
 public function testCanSetKeyAndGetCurrencies()
 {
     $this->rate->setKey('USD_EUR');
     $this->assertEquals('USD', $this->rate->getFromIso());
     $this->assertEquals('EUR', $this->rate->getToIso());
 }