@@ -16,6 +16,11 @@ class PriceBoxTagsTest extends \PHPUnit\Framework\TestCase
16
16
*/
17
17
private $ priceCurrencyInterface ;
18
18
19
+ /**
20
+ * @var \Magento\Directory\Model\Currency | \PHPUnit_Framework_MockObject_MockObject
21
+ */
22
+ private $ currency ;
23
+
19
24
/**
20
25
* @var \Magento\Framework\Stdlib\DateTime\TimezoneInterface | \PHPUnit_Framework_MockObject_MockObject
21
26
*/
@@ -46,6 +51,9 @@ protected function setUp()
46
51
$ this ->priceCurrencyInterface = $ this ->getMockBuilder (
47
52
\Magento \Framework \Pricing \PriceCurrencyInterface::class
48
53
)->getMock ();
54
+ $ this ->currency = $ this ->getMockBuilder (\Magento \Directory \Model \Currency::class)
55
+ ->disableOriginalConstructor ()
56
+ ->getMock ();
49
57
$ this ->timezoneInterface = $ this ->getMockBuilder (
50
58
\Magento \Framework \Stdlib \DateTime \TimezoneInterface::class
51
59
)->getMock ();
@@ -82,7 +90,7 @@ protected function setUp()
82
90
public function testAfterGetCacheKey ()
83
91
{
84
92
$ date = date ('Ymd ' );
85
- $ currencySymbol = '$ ' ;
93
+ $ currencyCode = 'USD ' ;
86
94
$ result = 'result_string ' ;
87
95
$ billingAddress = ['billing_address ' ];
88
96
$ shippingAddress = ['shipping_address ' ];
@@ -95,7 +103,7 @@ public function testAfterGetCacheKey()
95
103
'- ' ,
96
104
[
97
105
$ result ,
98
- $ currencySymbol ,
106
+ $ currencyCode ,
99
107
$ date ,
100
108
$ scopeId ,
101
109
$ customerGroupId ,
@@ -104,7 +112,8 @@ public function testAfterGetCacheKey()
104
112
);
105
113
$ priceBox = $ this ->getMockBuilder (\Magento \Framework \Pricing \Render \PriceBox::class)
106
114
->disableOriginalConstructor ()->getMock ();
107
- $ this ->priceCurrencyInterface ->expects ($ this ->once ())->method ('getCurrencySymbol ' )->willReturn ($ currencySymbol );
115
+ $ this ->priceCurrencyInterface ->expects ($ this ->once ())->method ('getCurrency ' )->willReturn ($ this ->currency );
116
+ $ this ->currency ->expects ($ this ->once ())->method ('getCode ' )->willReturn ($ currencyCode );
108
117
$ scope = $ this ->getMockBuilder (\Magento \Framework \App \ScopeInterface::class)->getMock ();
109
118
$ this ->scopeResolverInterface ->expects ($ this ->any ())->method ('getScope ' )->willReturn ($ scope );
110
119
$ scope ->expects ($ this ->any ())->method ('getId ' )->willReturn ($ scopeId );
0 commit comments