@@ -68,15 +68,17 @@ protected function setUp()
68
68
69
69
/**
70
70
* @param string $localeCode
71
+ * @param string $currencyCode
71
72
* @param array $expectedResult
72
73
* @dataProvider getPriceFormatDataProvider
73
74
*/
74
- public function testGetPriceFormat ($ localeCode , array $ expectedResult ): void
75
+ public function testGetPriceFormat ($ localeCode , $ currencyCode , array $ expectedResult ): void
75
76
{
76
77
$ this ->scope ->expects ($ this ->once ())
77
78
->method ('getCurrentCurrency ' )
78
79
->willReturn ($ this ->currency );
79
80
81
+ $ this ->currency ->method ('getCode ' )->willReturn ($ currencyCode );
80
82
$ result = $ this ->formatModel ->getPriceFormat ($ localeCode );
81
83
$ intersection = array_intersect_assoc ($ result , $ expectedResult );
82
84
$ this ->assertCount (count ($ expectedResult ), $ intersection );
@@ -88,18 +90,19 @@ public function testGetPriceFormat($localeCode, array $expectedResult): void
88
90
*/
89
91
public function getPriceFormatDataProvider (): array
90
92
{
93
+ $ swissGroupSymbol = INTL_ICU_VERSION >= 59.1 ? '’ ' : '\'' ;
91
94
return [
92
- ['en_US ' , ['decimalSymbol ' => '. ' , 'groupSymbol ' => ', ' ]],
93
- ['de_DE ' , ['decimalSymbol ' => ', ' , 'groupSymbol ' => '. ' ]],
94
- ['de_CH ' , ['decimalSymbol ' => '. ' , 'groupSymbol ' => '\'' ]],
95
- ['uk_UA ' , ['decimalSymbol ' => ', ' , 'groupSymbol ' => ' ' ]]
95
+ ['en_US ' , ' USD ' , ['decimalSymbol ' => '. ' , 'groupSymbol ' => ', ' ]],
96
+ ['de_DE ' , ' EUR ' , ['decimalSymbol ' => ', ' , 'groupSymbol ' => '. ' ]],
97
+ ['de_CH ' , ' CHF ' , ['decimalSymbol ' => '. ' , 'groupSymbol ' => $ swissGroupSymbol ]],
98
+ ['uk_UA ' , ' UAH ' , ['decimalSymbol ' => ', ' , 'groupSymbol ' => ' ' ]]
96
99
];
97
100
}
98
101
99
102
/**
100
103
*
101
- * @param mixed $value
102
- * @param float $expected
104
+ * @param mixed $value
105
+ * @param float $expected
103
106
* @dataProvider provideNumbers
104
107
*/
105
108
public function testGetNumber ($ value , $ expected ): void
0 commit comments