Skip to content

Commit 7202deb

Browse files
author
Yurii Hryhoriev
committed
MAGETWO-57070: [GitHub] Locale\Format throws away country part, results in wrong number format #5073
1 parent 7514ddc commit 7202deb

File tree

1 file changed

+6
-46
lines changed

1 file changed

+6
-46
lines changed

lib/internal/Magento/Framework/Locale/Test/Unit/FormatTest.php

Lines changed: 6 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@ protected function setUp()
7070
public function testGetPriceFormat($localeCode, $expectedResult)
7171
{
7272
$result = $this->formatModel->getPriceFormat($localeCode);
73-
$this->assertEquals($result, $expectedResult);
73+
$intersection = array_intersect_assoc($result, $expectedResult);
74+
$this->assertCount(count($expectedResult), $intersection);
7475
}
7576

7677
/**
@@ -79,51 +80,10 @@ public function testGetPriceFormat($localeCode, $expectedResult)
7980
public function getPriceFormatDataProvider()
8081
{
8182
return [
82-
[
83-
'en_US',
84-
[
85-
'pattern' => null,
86-
'precision' => 2,
87-
'requiredPrecision' => 2,
88-
'decimalSymbol' => '.',
89-
'groupSymbol' => ',',
90-
'groupLength' => 3,
91-
'integerRequired' => 1
92-
]
93-
], [
94-
'de_DE',
95-
[
96-
'pattern' => null,
97-
'precision' => 2,
98-
'requiredPrecision' => 2,
99-
'decimalSymbol' => ',',
100-
'groupSymbol' => '.',
101-
'groupLength' => 3,
102-
'integerRequired' => 1
103-
]
104-
], [
105-
'de_CH',
106-
[
107-
'pattern' => null,
108-
'precision' => 2,
109-
'requiredPrecision' => 2,
110-
'decimalSymbol' => '.',
111-
'groupSymbol' => '\'',
112-
'groupLength' => 3,
113-
'integerRequired' => 1
114-
]
115-
], [
116-
'uk_UA',
117-
[
118-
'pattern' => null,
119-
'precision' => 2,
120-
'requiredPrecision' => 2,
121-
'decimalSymbol' => ',',
122-
'groupSymbol' => ' ',
123-
'groupLength' => 3,
124-
'integerRequired' => 1
125-
]
126-
]
83+
['en_US', ['decimalSymbol' => '.', 'groupSymbol' => ',']],
84+
['de_DE', ['decimalSymbol' => ',', 'groupSymbol' => '.']],
85+
['de_CH', ['decimalSymbol' => '.', 'groupSymbol' => '\'']],
86+
['uk_UA', ['decimalSymbol' => ',', 'groupSymbol' => ' ']]
12787
];
12888
}
12989
}

0 commit comments

Comments
 (0)