/** * @ZF-9519 */ public function testSetValueWithoutLocale() { $currency = new Zend_Currency('RUB', 'ru_RU'); require_once 'Currency/ExchangeTest.php'; $this->assertEquals(null, $currency->getService()); $currency->setService(new ExchangeTest()); $this->assertTrue($currency->getService() instanceof Zend_Currency_CurrencyInterface); $currency->setValue(100, 'USD'); $this->assertEquals(50, $currency->getValue()); $this->assertEquals('RUB', $currency->getShortName()); }
/** * @group ZF-10751 */ public function testSetService() { $currency = new Zend_Currency(); $currency->setService('Zend_Currency_Service'); $this->assertTrue($currency->getService() instanceof Zend_Currency_Service); }
/** * Exchange tests */ public function testExchangeValues() { $currency = new Zend_Currency(array('currency' => 'EUR', 'locale' => 'de_AT', 'value' => 100)); $currency2 = new Zend_Currency(array('currency' => 'EUR', 'locale' => 'de_AT', 'value' => 100)); require_once 'Currency/ExchangeTest.php'; $this->assertEquals(null, $currency->getService()); $currency->setService(new ExchangeTest()); $this->assertTrue($currency->getService() instanceof Zend_Currency_CurrencyInterface); $currency->setService('ExchangeTest'); $this->assertTrue($currency->getService() instanceof Zend_Currency_CurrencyInterface); }