protected function saveCached(\Money\CurrencyPair $pair) { if ($this->cache) { $cacheKey = $this->getCacheKey($pair->getCounterCurrency(), $pair->getBaseCurrency()); $this->cache->save($cacheKey, $pair, self::CACHE_LIFETIME); } }
public function testGetCounterCurrency() { $pair = new CurrencyPair(CurrencyProxy::determine('EUR'), CurrencyProxy::determine('USD'), 1.25); $this->assertEquals(CurrencyProxy::determine('USD'), $pair->getCounterCurrency()); }
public function testGetCounterCurrency() { $pair = new CurrencyPair(new Currency('EUR'), new Currency('USD'), 1.25); $this->assertEquals(new Currency('USD'), $pair->getCounterCurrency()); }