summaryrefslogtreecommitdiff
path: root/tests/unit/I18N/core/NumberFormatInfoTest.php
diff options
context:
space:
mode:
authorctrlaltca <ctrlaltca@gmail.com>2014-08-26 16:59:21 +0200
committerctrlaltca <ctrlaltca@gmail.com>2014-08-26 16:59:21 +0200
commit74b31be9515eddfa63005d6760614badfaba9fea (patch)
tree47c952901dcb5eccd6dd8b7c6ee7e0b6bf176510 /tests/unit/I18N/core/NumberFormatInfoTest.php
parent2b11341614ac4a15be697fa8acad07055154ac54 (diff)
parent0c5026b55cde5c104f10686afd8b441568175d38 (diff)
Merge pull request #530 from pradosoft/prado-3.2.43.2.4prado-3.2
Backports for Prado 3.2.4
Diffstat (limited to 'tests/unit/I18N/core/NumberFormatInfoTest.php')
-rw-r--r--tests/unit/I18N/core/NumberFormatInfoTest.php36
1 files changed, 17 insertions, 19 deletions
diff --git a/tests/unit/I18N/core/NumberFormatInfoTest.php b/tests/unit/I18N/core/NumberFormatInfoTest.php
index d522144f..6243095a 100644
--- a/tests/unit/I18N/core/NumberFormatInfoTest.php
+++ b/tests/unit/I18N/core/NumberFormatInfoTest.php
@@ -8,27 +8,27 @@ Prado::using('System.I18N.core.NumberFormatInfo');
* @package System.I18N.core
*/
class NumberFormatInfoTest extends PHPUnit_Framework_TestCase {
-
+
function testCurrencyPatterns() {
$numberInfo = NumberFormatInfo::getCurrencyInstance();
-
+
//there should be 2 decimal places.
$this->assertEquals($numberInfo->DecimalDigits,2);
$this->assertEquals($numberInfo->DecimalSeparator,'.');
$this->assertEquals($numberInfo->GroupSeparator,',');
-
+
//there should be only 1 grouping of size 3
$groupsize = array(3,false);
$this->assertEquals($numberInfo->GroupSizes, $groupsize);
-
+
//the default negative pattern prefix and postfix
$negPattern = array('-¤','');
$this->assertEquals($numberInfo->NegativePattern, $negPattern);
-
+
//the default positive pattern prefix and postfix
$negPattern = array('¤','');
$this->assertEquals($numberInfo->PositivePattern, $negPattern);
-
+
//the default currency symbol
$this->assertEquals($numberInfo->CurrencySymbol, 'US$');
$this->assertEquals($numberInfo->getCurrencySymbol('JPY'), '¥');
@@ -38,51 +38,49 @@ class NumberFormatInfoTest extends PHPUnit_Framework_TestCase {
$this->assertEquals($numberInfo->PositiveSign, '+');
$this->assertEquals($numberInfo->NaNSymbol, '�');
$this->assertEquals($numberInfo->PercentSymbol, '%');
- $this->assertEquals($numberInfo->PerMilleSymbol, '‰');
+ $this->assertEquals($numberInfo->PerMilleSymbol, '‰');
}
function testPatternsSet() {
$numberInfo = NumberFormatInfo::getInstance();
-
+
$numberInfo->DecimalDigits = 0;
$this->assertEquals($numberInfo->DecimalDigits,0);
-
+
$numberInfo->DecimalSeparator = ',';
$this->assertEquals($numberInfo->DecimalSeparator,',');
-
+
$numberInfo->GroupSeparator = ' ';
$this->assertEquals($numberInfo->GroupSeparator,' ');
-
+
$numberInfo->GroupSizes = array(2,3);
$groupsize = array(2,3);
$this->assertEquals($numberInfo->GroupSizes, $groupsize);
-
+
$numberInfo->NegativePattern = array('-$$','.');
$negPattern = array('-$$','.');
$this->assertEquals($numberInfo->NegativePattern, $negPattern);
-
+
$numberInfo->PositivePattern = array('YY','.');
$negPattern = array('YY','.');
$this->assertEquals($numberInfo->PositivePattern, $negPattern);
-
+
//the default CurrencySymbol symbol
$numberInfo->CurrencySymbol = '$$$';
$this->assertEquals($numberInfo->CurrencySymbol, '$$$');
}
-
+
function testLocalizedPatterns() {
$fr = NumberFormatInfo::getInstance('fr');
$de = NumberFormatInfo::getInstance('de');
$en = NumberFormatInfo::getInstance('en_US');
-
+
$this->assertEquals($fr->DecimalSeparator, ',');
$this->assertEquals($de->DecimalSeparator, ',');
$this->assertEquals($en->DecimalSeparator, '.');
-
+
$this->assertEquals($fr->GroupSeparator, ' ');
$this->assertEquals($de->GroupSeparator, '.');
$this->assertEquals($en->GroupSeparator, ',');
}
}
-
-?> \ No newline at end of file