/** * @inheritdoc */ public function saveRatioListFromRatioProvider() { if (!$this->ratioProvider) { throw new MoneyException("no ratio provider defined"); } foreach ($this->getCurrencyCodeList() as $currencyCode) { if ($currencyCode != $this->getReferenceCurrencyCode()) { $ratio = $this->ratioProvider->fetchRatio($this->getReferenceCurrencyCode(), $currencyCode); $this->saveRatio($currencyCode, $ratio); } } }
public function testExceptionForUnknownCurrency() { $this->setExpectedException('Tbbc\\MoneyBundle\\MoneyException'); $this->ratioProvider->fetchRatio('ZZZ', 'USD'); }