Пример #1
0
 protected function saveCached(\Money\CurrencyPair $pair)
 {
     if ($this->cache) {
         $cacheKey = $this->getCacheKey($pair->getCounterCurrency(), $pair->getBaseCurrency());
         $this->cache->save($cacheKey, $pair, self::CACHE_LIFETIME);
     }
 }
Пример #2
0
 public function testGetCounterCurrency()
 {
     $pair = new CurrencyPair(CurrencyProxy::determine('EUR'), CurrencyProxy::determine('USD'), 1.25);
     $this->assertEquals(CurrencyProxy::determine('USD'), $pair->getCounterCurrency());
 }
Пример #3
0
 public function testGetCounterCurrency()
 {
     $pair = new CurrencyPair(new Currency('EUR'), new Currency('USD'), 1.25);
     $this->assertEquals(new Currency('USD'), $pair->getCounterCurrency());
 }