Просмотр исходного кода

[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 лет назад
Родитель
Сommit
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'));
+    }
 }