瀏覽代碼

[ZF-9181] Zend_Currency:

- fixed options

git-svn-id: http://framework.zend.com/svn/framework/standard/trunk@21058 44c647ce-9c0f-0410-b52a-842ac1e357ba
thomas 16 年之前
父節點
當前提交
2b2f872e3a
共有 2 個文件被更改,包括 10 次插入1 次删除
  1. 1 1
      library/Zend/Currency.php
  2. 9 0
      tests/Zend/CurrencyTest.php

+ 1 - 1
library/Zend/Currency.php

@@ -100,7 +100,7 @@ class Zend_Currency
 
         $this->setLocale($locale);
         // Get currency details
-        if (!isset($options['currency']) || !is_array($options)) {
+        if (!isset($this->_options['currency']) || !is_array($options)) {
             $this->_options['currency'] = self::getShortName($options, $this->_options['locale']);
         }
 

+ 9 - 0
tests/Zend/CurrencyTest.php

@@ -788,4 +788,13 @@ class Zend_CurrencyTest extends PHPUnit_Framework_TestCase
         $currency->setService('ExchangeTest');
         $this->assertTrue($currency->getService() instanceof Zend_Currency_CurrencyInterface);
     }
+
+    /**
+     * IsLess values
+     */
+    public function testContructingPrecisionValues()
+    {
+        $currency  = new Zend_Currency(array('value' => 100.5));
+        $this->assertEquals('€ 100,50', $currency->toString('de_AT'));
+    }
 }