Exemple #1
0
 public function testGetRates()
 {
     $this->assertEquals(1, $this->bank->getRate('USD', 'USD'));
     $this->exchanger->addRate('CHF', 'USD', 0.5);
     $this->assertEquals(0.5, $this->bank->getRate('CHF', 'USD'));
 }
 protected function setUp()
 {
     $exchanger = new ArrayExchanger();
     $exchanger->addRate('CHF', 'USD', 0.5);
     $this->bank = new MultiCurrencyBank(array('USD', 'CHF'), 'USD', $exchanger);
 }
Exemple #3
0
 public function testAddRate()
 {
     $this->exchanger->addRate('USD', 'CHF', 0.5);
 }