public function testRatio() { $eur = Money::EUR(100); $sameEur = $this->manager->convert($eur, "EUR"); $this->assertEquals(Money::EUR(100), $sameEur); try { $this->manager->convert($eur, "USD"); $this->assertTrue(false); } catch (MoneyException $e) { $this->assertTrue(true); } $this->manager->saveRatio("USD", 1.25); $usd = $this->manager->convert($eur, "USD"); $this->assertEquals(Money::USD(125), $usd); $this->manager->saveRatio("CAD", 1.5); $cad = $this->manager->convert($usd, "CAD"); $this->assertEquals(Money::CAD(150), $cad); }