本文整理汇总了PHP中Zend_Currency::getService方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Currency::getService方法的具体用法?PHP Zend_Currency::getService怎么用?PHP Zend_Currency::getService使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_Currency
的用法示例。
在下文中一共展示了Zend_Currency::getService方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testSetValueWithoutLocale
/**
* @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());
}
示例2: testSetService
/**
* @group ZF-10751
*/
public function testSetService()
{
$currency = new Zend_Currency();
$currency->setService('Zend_Currency_Service');
$this->assertTrue($currency->getService() instanceof Zend_Currency_Service);
}
示例3: testExchangeValues
/**
* 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);
}